Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic 5 Educational Program! Command Button Invokes another Com

Status
Not open for further replies.

ifilikeituwill

Technical User
May 6, 2009
15
0
0
US
This is in Visual Basic 5. I open a new project and chose a Standard.Exe Form

Source Code follows!

Private Sub Command1_Click()
Text1.Text = "1 Pressed!"
End Sub
Private Sub Command2_Click()
Text1.Text = "2 Pressed!"
End Sub
Private Sub Command3_Click()
Text1.Text = "3 Pressed!"
End Sub
Private Sub Command4_Click()
Text2.Text = "1 invoked 4!"
End Sub
Private Sub Command5_Click()
Text2.Text = "2 invoked 5!"
End Sub
Private Sub Command6_Click()
Text2.Text = "3 invoked 6!"
End Sub
Private Sub Exit_Click()
End
End Sub

If some one can get this to work, can you try it by making the following changes:

Command4.Visible = False
Command5.Visible = False
Command6.Visible = False

Thanks for reading my post!

ifilikeituwill
 
If some one can get this to work
You have not said how it's supposed to work. When you write a program, the first thing to do is clearly state your objectives.
 
Is this what you are after?

Private Sub Command1_Click()
Text1.Text = "1 Pressed!"
Command4.Visible = False
Command4_Click
End Sub
Private Sub Command2_Click()
Text1.Text = "2 Pressed!"
Command5.Visible = False
Command5_Click
End Sub
Private Sub Command3_Click()
Text1.Text = "3 Pressed!"
Command6.Visible = False
Command6_Click
End Sub
Private Sub Command4_Click()
Text2.Text = "1 invoked 4!"
End Sub
Private Sub Command5_Click()
Text2.Text = "2 invoked 5!"
End Sub
Private Sub Command6_Click()
Text2.Text = "3 invoked 6!"
End Sub
Private Sub Exit_Click()
End
End Sub
 
Hello Revolution1200!
Yes that's correct for Example 1 and Example 2.
These migraine Headaches must of messed me up from thinking!
I also lose sight from them too! Thanks for you expertise!!!

In the second example i made command buttons 4, 5, and 6 invisible by checking the Properties box to invisible False!
Worked nicely!

I actually have 2 more projects I will post for help!!
Thanks again for the basics!

Ifilikeituwill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top