Code examples for events (e.g. buttons) for a newbie

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2006
Posts: 8
Reputation: Bernard Kane is an unknown quantity at this point 
Solved Threads: 0
Bernard Kane Bernard Kane is offline Offline
Newbie Poster

Code examples for events (e.g. buttons) for a newbie

 
0
  #1
Jul 10th, 2006
Hi

I am a new user of VB (or any prgramming for that matter) and keen to learn. A very simple example of what I was looking for was the code for a button to open another form. Does anyone know where I can access simple event proceedure codes - a sort of list of basics if you like. Any help would be appreciated.

Regards

Bernard
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Code examples for events (e.g. buttons) for a newbie

 
0
  #2
Jul 10th, 2006
Hmn, as far as I know, The closest thing you'll get is the MSDN library, and good luck making a lot of sense of it.... a Visual Basic 6 example of this, assuming you have 2 forms, form1 and form2, would look like this in the command button:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. form2.visible = true
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 8
Reputation: Bernard Kane is an unknown quantity at this point 
Solved Threads: 0
Bernard Kane Bernard Kane is offline Offline
Newbie Poster

Re: Code examples for events (e.g. buttons) for a newbie

 
0
  #3
Jul 10th, 2006
Originally Posted by Comatose
Hmn, as far as I know, The closest thing you'll get is the MSDN library, and good luck making a lot of sense of it.... a Visual Basic 6 example of this, assuming you have 2 forms, form1 and form2, would look like this in the command button:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. form2.visible = true
Many thanks but I have tried this without much luck. I agree that the MSDN Library is much for someone called Einstein than a humble beginner like me.

Thanks for your input anyway.

Regards

Bernard
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Code examples for events (e.g. buttons) for a newbie

 
0
  #4
Jul 10th, 2006
Is this in vb6, or .NET? If it's in VB4, 5, or 6, post the project in a .zip and I'll check it out.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 21
Reputation: lover99509 is an unknown quantity at this point 
Solved Threads: 1
lover99509 lover99509 is offline Offline
Newbie Poster

Re: Code examples for events (e.g. buttons) for a newbie

 
1
  #5
Jul 31st, 2006
You can use the show and hide
if you have tow forms form1 in which your command button is placed and form2 the one you want to go to when you click the button you can easily write in the click event of the command button

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command2_Click()
  2. form1.hide
  3. form2.show
  4. End Sub
Last edited by Comatose; Jul 31st, 2006 at 12:01 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Code examples for events (e.g. buttons) for a newbie

 
0
  #6
Jul 31st, 2006
Originally Posted by lover99509
You can use the show and hide
if you have tow forms form1 in which your command button is placed and form2 the one you want to go to when you click the button you can easily write in the click event of the command button

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command2_Click()
  2. form1.hide
  3. form2.show
  4. End Sub
Nice Post lover99509, but it should be also noted that using the .hide and the .show method is significantly slower on benchmark tests than directly altering the .Visible property itself....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC