Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to link one button to any form in c# windows form application (e.g) if I click next button then it links related form for next page.
Posted
Comments
OriginalGriff 20-Jul-14 2:26am    
Don't repost your question - use the "improve question" widget instead.
I have deleted the older version.
OriginalGriff 20-Jul-14 2:29am    
That doesn't make a lot of sense - remember that we can't see your screen, access your HDD, or read your mind - so we occult get to work with what you tell us.

So try to explain in better detail, perhaps with an example?
And remember - edit this one, don't create a new one!

1 solution

If you want to open multiple form using single button then, your form name needs to be like this..form1,form2,form3 or I can say.. frmwindow1,frmwindow2.. Means form name must be same before numeric in last.

try this,
I am hoping your that button is on Mdi parent form for better visualization.
In your button click event insert this code.

i=i+1
call ViewChildForm("Form" & i)


and define viewchildform as follow,

VB
Private Sub ViewChildForm(frm As Form)
    frm.MdiParent = Me
    frm.Show()
End Sub

Here I consider, your all form names starts with Form and end with sequence of number.
like form1,form2,form3 etc.
I define i as integer publicly in that MDI parent form. with initial value=0.

Use this logic.
 
Share this answer
 
Comments
nilesh sawardekar 20-Jul-14 15:46pm    
Why downvoted?. we are not here to waste time of us and others..we just give logic to use..so kindly keep at least some respect.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900