Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am new to vb so can anyone help me please?

 

I have 3 forms - Menu, Maintenance and View. I want to loan either the Maintenace form or the View form via a button_click on the Menu form.

 

Thanks

Posted
"Public Class frmMaint" is the name of the Class for the Maintenance Form, "Public Class frmMenu" for the Menu Form and "Public Class frmView" for the View form.
  • *Experts*
Posted

Then use this:

Dim fMaint As New frmMaint 'of course you call the variable something else than fMaint
fMaint.Show()

You use frmMaint becuase thats name of the your form class.

:)

Posted

Thanks for your help with the forms that I'm setting up. Could you give me just a little more of your time?

 

I can now access the Maintenance form and View form from the Menu form. How do I return to the Menu form when I button_click on Exit from either of the others?

  • *Experts*
Posted
What do you mean return? If you just used the code I showed you the Menu form would still be there visible, so if you close the frmMaint form you should still be able to see the Menu form.
  • *Experts*
Posted
So on exit of your frmMaint you create a new instance of your menu form and show it? What is your code on the button_click event handler? There shouldnt be another instance of frmMenu if you didnt create it yourself.
Posted

I used the End command - something not advised I know.

 

I then took that out and replaced it with the Dim statement to take me back to the Menu.

 

I know that there is a better way of closing the Maintenance form with the "Nothing" statement but , for the life of me, I just can't find how to use it in any of my reference materials.

Posted

I think I can answer this, :p

 

Ok if you mean like how to like make a form disapear, then go like this:

 

Dim TheFormName As New TheFormName
'Create instance of TheFormName (the form that you want to disapear)

TheFormName.Hide

 

I think that's what you mean :)

"Reality is fake, Dreams are for real"
  • 1 month later...
Posted

linking forms

 

i also need some help, i think its quite similar.

 

im making a game and the start menu has 4 command buttons, i want a different form to load up for each command.

 

eg, the game formk to load wen play is pressed and options appear wen options is pressed.

 

all my forms are named as default eg form1, form2

 

any help would be appreciated

 

thanks

Posted

First of all ... don't keep the default Forms names ... next week you'll start your project and will have to open all of them to know what in them... :p

 

Next... I don't know what kind of game you're trying to do but if you have this kind of questions I advise you to read some books before proceding... Bigger troubles are yet to come!! :D

 

Answering your question you just have to put this code (changing only the name of the form you want to open...) in the click event of each button:

 

Dim form1 As New form1
form1.Show()

 

If you want the form to be Modal try this:

 

Dim form1 As New form1
form1.Showdialog()

 

 

 

Have fun ... and don't forget my advise... read some good books and mess around with VB.net a little more time! :)

Software bugs are impossible to detect by anybody except the end user.
Posted

lol

 

i have already made the game but in a simpler version. its a game where the computer thinks of a number 1- 1000 and uve gotta guess it rite in ten tries.

 

im trying to improve it by adding more options and i figuered out how to link forms just after i posted the reply

 

but thanks anyway

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...