1.

Solve : too many arguments - Visual basic?

Answer»

i am trying to make my app close out of my first form and open the second but i get the error "too many arguments to 'Public sub hide()'." I am a complete noob to VB. I have tried looking around on the web for an answer and its all pretty complicated. heres the peice of code i cant get to work.
Code: [Select]Me.Hide(Me)
Form2.Show(Form2)the error is quite intuitive. if you GIVE one argument to hide() and it complains of too many arguments, then don't give it any arguments... try that.
as much as i hate to say this, but, since you are a newbie, you should go get a book on vb and read/learn how to use vb first. (or search the internet if you can't get any vb BOOKS). great it makes sence - EXCEPT THE FACT THAT IT WOULDNT DO ANYTHING WITHOUT THE ARGUMENT. how would it hide this if i take off the code that TELLS it to hide? and as far as books im not spending money on books at this point. i hardly know if i like visual basic, i wouldnt go out and spend all the money i have on a book about it. As i said i tried searching the web for this and didnt understand what people said.Quote from: gamerx365 on July 17, 2007, 03:56:25 PM

and as far as books im not spending money on books at this point.
you have never been to a library?yeah thats great if you can get to a library. maybe ill go to one sometime in the next coule of weeks if i pay my parents. lol. anyway i just want to know how to fix this problem. i have the whole program done but this part and ive tried EVERYTHING i can think of which isnt much so...gamerx365 you weren't really clear on whether or not you've tried not using any arguments for hide(). I.e. instead of Me.Hide(Me) then just Me.Hide(). Now I haven't coded in VB for quite some time but I'm pretty sure that's the way to use it.Quote from: gamerx365 on July 15, 2007, 08:41:20 PM
Code: [Select]Me.Hide(Me)
Form2.Show(Form2)
Yes Deerpark is correct you only need to use
Code: [Select]Form2.Show
Me.Hide
It BETTER to show the next Form then Hide the first one.


Discussion

No Comment Found