Results 1 to 11 of 11

Thread: Button vb Default

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Location
    uk liverpool
    Posts
    238

    Button vb Default

    Is their a way to make a command button back to vb default with code please

    Thanks Paul

  2. #2
    Fanatic Member daydee's Avatar
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    560

    Re: Button vb Default

    Originally posted by whothis
    Is their a way to make a command button back to vb default with code please

    Thanks Paul
    How do you mean "back to vb default" ?
    Give your music collection a whole new life with PartyTime Jukebox

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Location
    uk liverpool
    Posts
    238

    Default

    As in when we double click on the CommandButton in the ToolBox
    and it goes on the form yer know Command1

  4. #4

  5. #5

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Location
    uk liverpool
    Posts
    238

    Cos

    Originally posted by Wokawidget
    Errr...why do you want to do it at runtime???

    VB Code:
    1. Command1.Default = True

    Woof
    Thats what i need to do at runtime other thing are involed which i find hard to explain .

    Thanks for the help ill try it out .

    Creamfeilds nar kids are thou in there christain dior wierd wellies lol

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Location
    uk liverpool
    Posts
    238

    Command1.Default = True

    Dont set the command button back to its (default) as in when it was on the toolbox .i can do this but i thought instead of code the color ,size,caption,font etc i thought their might of been some quick code called default ..?

  8. #8

  9. #9
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736
    well, you could store all the information at loadtime and them call them all back with a subroutine...

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    oooooooooh, hell, I get it now.....

    Try this:
    VB Code:
    1. dim objTempCmd as CommandButton
    2. set objTempCmd = myForm.Controls.Add "VB.CommandButton","TempCmd"
    3. Button1.Backcolor = objTempCmd.BackColor
    4. .
    5. .
    6. .
    7. .
    8. 'You can set as many or as little of the properties as you want
    9.  
    10. 'When done, remove the temp button
    11. myForm.Controls.Remove "TempButton"

    I think that will work....

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  11. #11
    Hyperactive Member Vishalgiri's Avatar
    Join Date
    Oct 2003
    Location
    India
    Posts
    345
    also you can make true the keypreview propertiy and then when key pressed if keyAscii = 13 then command1.click
    Regards,
    Vishalgiri Goswami
    Gujarat, ( INDIA ).
    ---------------------

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