Results 1 to 6 of 6

Thread: Move a Command Button in Frame

  1. #1

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765

    Move a Command Button in Frame

    Ok I have a Command Button which will move a Frame to the side of the form, so it gets out of the way of the user. I've placed a Command Button in the top right hand corner of the Frame to do this.

    Whats the code so that when I have the Frame hidden, I can move the Command Button to the left side of the Frame?

    At the moment I'm hiding the Frame by doing,
    Frame1.Left = Frame1.Left + Frame1.Width - 200

    The 200 is so that there is room for the command button.


    Its going to be something really simple, but I just can't figure out what........
    Don't Rate my posts.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    If you want to 'hide' it then why not just use Frame1.Visible=false?

  3. #3
    vbCowboy
    Guest
    If the command button is on the frame it will be hidden when the frame is hidden. If this is a different command button then do

    VB Code:
    1. cboCommandButton.left = me.left ' This will set it the forms left border
    2. 'to hide the frame
    3. frame1.visible = false

    I don't think I understand what you are trying to do...

  4. #4

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Well I just want it off the form. Its on the right hand edge, so, add the forms width to its .Left and then minus the width of the command button.

    Ok got it.
    As I said, pretty simple.

    Frame1.Left = Frame1.Left + Frame1.Width - Command1.Width
    Command1.Left = Command1.Left - 1100
    Don't Rate my posts.

  5. #5

    Thread Starter
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Ok, heres another question.

    The Command Button's Captions are "<" and ">"

    The problem is, when its clicked, it gets a line around it, which makes the caption hard to read, as the command button is about the size of the character "<"

    How can I get rid of the border thing
    Is Setting the Focus to something else the best way???
    Don't Rate my posts.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can make the button a little bigger or use a picturebox instead, thats the easiest anyway.

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