Support Forums

Full Version: beginner, help in vb.net[solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to write my first program it has basically a button, a label and a listbox and you can choose from the list what option you want and it will take you to that page(by clicking the button).

Problem is I'm not sure about how to make the next 'page', should i make all the labels, buttons etc invisible and that would look like it changed.

for example if the user selects 'length conversion' from the list how do i make it change forms(hide everything on the main page or create a new form??)
You have more ways to do this....

Every element has method "Visible"
Code:
Text1.Visible = False

Will hide the Text1 element

Then you can also create a new form for every page you need and then load it once the button is pressed and unload the main one

edit: I'm sorry I somehow did notice the .net so I don't know if that was helpful.
Yes I'm currently using the visible=false method but that gets very messy as i need to add more labels etc... how would i go about loading and unloading new forms?

thanks
(10-12-2009, 02:50 AM)k1ll3r Wrote: [ -> ]Yes I'm currently using the visible=false method but that gets very messy as i need to add more labels etc... how would i go about loading and unloading new forms?

thanks

You can create new forms and add them to your project, I assume you know how to do that

Now in the Button_Click sub, you insert
Code:
Dim newForm as frmPage2
newForm.show

where frmPage2 is the name of the form you want to show

with if checks you can load different forms then
(10-12-2009, 02:55 AM)NinjaGeek Wrote: [ -> ]You can create new forms and add them to your project, I assume you know how to do that

Now in the Button_Click sub, you insert
Code:
Dim newForm as frmPage2
newForm.show

where frmPage2 is the name of the form you want to show

with if checks you can load different forms then
I did that and it displays an error saying "type form2 is not defined"
(10-12-2009, 03:09 AM)k1ll3r Wrote: [ -> ]I did that and it displays an error saying "type form2 is not defined"

Well I'm sorry but my Knowledge in .NET is very limited you'll need to wait for the gurus to get online
until then check this out
http://www.devcity.net/Articles/94/1/.aspx
nvm solved