You call and initiate the second form, from the first forms load event:
Sub Form1_Onload ( byval sender as object, byval e as system.eventargs) Handles Form1.OnLoad dim NewForm as new Form2 NewForm.Show() '.... End Sub
Using this technique, you can even set values of controls (or add new controls,) in the second form.
dim NewForm as new form2 'assume there is a textbox txtEntry on Form2 NewForm.txtEntry.Text ="Hello I'm on Form 2" NewForm.Show() 'Form2 will open with the textbox populated
You can even open the second form as a modal dialog and process results.
Dim NewForm as New Form2 If NewForm.ShowDialog = DialogResult.OK then 'Result of OK was returned Else 'Other Result end if
On your second form you would probably have a button that would set the dialog result of the form to OK provided what you wanted to happen on the form happened.
simply just paste the code in the form 1 load event
if you want to load as dialog then put this code:
and as to create new form from form 1 then
Dim Nform as new Form Nform.show Nform.text = "Form2: Title" ... ....
You have done.
if this is not your question then please elaborate this
hi i hope it could be help you
1.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
3 Form2.WindowState = FormWindowState.Normal
5 End Sub
by: Rossana kaw
Can you tell whether this discussion solve your quries or not?
if yes then please mark it as solve
if not then tell what you don't get it
I have two tables, I will call them first-half and second-half (of the year)
Table: first id jan feb mar apr ----------------------- 2 80 90 70 60 3 50 40 60 30 Table: second id jan feb mar apr ----------------------- 2 50 70 60 90 3 80 60 50 ...
Hi when I tried to insert my output the void displayed null or 0 can you tell me what's wrong with my rpogram? tnx
My main program
int choice; public static void main(String args) Scanner absorb = new Scanner(System.in); // phase 1 login cloth cl = new ...
i am trying to create a library management system which is supposed to be used to store/keep infp for the library and the library members( book title, author, name and picture for borrower and other stuffs). The app has 6 buttons, delete, save, add,previsous,next, and upload( for upload ...