Support Forums
beginner, help in vb.net[solved] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: beginner, help in vb.net[solved] (/showthread.php?tid=1301)



beginner, help in vb.net[solved] - k1ll3r - 10-12-2009

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??)


RE: beginner, help in vb.net - Gaijin - 10-12-2009

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.


RE: beginner, help in vb.net - k1ll3r - 10-12-2009

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


RE: beginner, help in vb.net - Gaijin - 10-12-2009

(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


RE: beginner, help in vb.net - k1ll3r - 10-12-2009

(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"


RE: beginner, help in vb.net - Gaijin - 10-12-2009

(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


RE: beginner, help in vb.net - k1ll3r - 10-12-2009

nvm solved