Results 1 to 6 of 6

Thread: How do I bring a control ontop of the others at runtime?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Question

    How do I make a Control get ontop of the other controlls at runtime?
    For example I want a frame I have made to go ontop of a text box when a user push a button.
    I have tried the folowing without any luck.
    Code:
    fraMenu.Visible = True
    -
    fraMenu.Enabled = True
    Thanks.


    -Lumin

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    ca, usa
    Posts
    91
    Use zOrder to set the position of a control at runtime ie.

    FraMenu.zOrder = 0 '0 = top of other controls
    FraMenu.zOrder = 1 '1 = bottom of other controls



    Hope this helps
    Jeremy
    [email protected]
    If its as simple as it sounds I guess I am not basic enough.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Unhappy Got some problems...

    Thanks. It realy looked like it could work.. but somehow I get an error while using it.

    Code:
    fraMenu.ZOrder = 0
    Error message: "Expected function or variable"

    anyone know why ?

    here is the code that I use the function in
    Code:
    Select Case txtChatSend.Text
        Case "?Connect", "?connect":
             fraConnect.ZOrder = 0
             txtChatSend.Text = ""
             Exit Sub
        Case "?Help", "?help":
             rtfChatDisplay.Text = rtfChatDisplay.Text & "help is on its way..."
             rtfChatDisplay.SelStart = Len(rtfChatDisplay.Text)
             txtChatSend.Text = ""
             Exit Sub
        Case "?Clear", "?clear":
             rtfChatDisplay.Text = ""
             rtfChatDisplay.SelStart = Len(rtfChatDisplay.Text)
             txtChatSend.Text = ""
             Exit Sub
      End Select
    is there any problem using ZOrder in a case function?

    Thanks.


    -Lumin


  4. #4
    Lively Member
    Join Date
    Jan 1999
    Location
    ca, usa
    Posts
    91
    Sorry about that it was a mistake on my part I use the = and you cant on Zorder, try


    FraMenu.Zorder 0 'Control ontop
    FraMenu.Zorder 1 'Control On Bottom

    This should work for you,
    Jeremy

    [email protected]
    If its as simple as it sounds I guess I am not basic enough.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Cool Thanks!!

    Thanks a lot, it realy worked

    I feel a little dumb that I didn't try that myself

    Anyway Thanks a lot for the help.


    -Lumin

  6. #6
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    Lightbulb Another way!

    When I need make controls appears and desappears I create groups of controls in a picuteBox and when I wish make visible/unvisible I just set the visible property of the PictureBox!

    Jefferson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width