|
-
Jun 22nd, 2006, 04:25 PM
#1
Thread Starter
New Member
excute code from form2 in form 1
So i am trying to make a basic title screen and have made two form2 form 1 has all of the controll to start game go to instuctions (ect) form 2 has a text box that will display some of the working of what is going on in the game and has text inside the text box.
What i am trying to do is after form 1 get through its code ... ( you click a button and it hides form 1 and shows form 2)... i want it to execute form2 code which is a sub prosedure that alligns the text to center in text box1.
This is my code so far:
CODE for form 1:
Public Class Form1
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Form2.Show()
Me.Hide()
End Sub
End Class
CODE for form 2:
Public Class Form2
Sub alligntext()
RichTextBox1.Text = HorizontalAlignment.Center
End Sub
End Class
-
Jun 22nd, 2006, 06:46 PM
#2
Hyperactive Member
Re: excute code from form2 in form 1
You'll want to write a routine for the Form2_Load event. You can access this event easily by double-clicking on form2 in the form2 designer.
-
Jun 22nd, 2006, 07:06 PM
#3
Re: excute code from form2 in form 1
Read the Forms in VB.NET tutorial in my signature.
-
Jun 22nd, 2006, 09:30 PM
#4
Thread Starter
New Member
Re: excute code from form2 in form 1
which one the home and learn because there are so many in your signature .... ><
-
Jun 22nd, 2006, 09:32 PM
#5
Re: excute code from form2 in form 1
Knock, knock.
 Originally Posted by jmcilhinney
Read the Forms in VB.NET tutorial in my signature.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|