View Full Version : A Simple (Hopefully) Visual Basic Question
cameronlanni
12-06-2006, 01:03 AM
I need to know how to close a form, (let's say a text box) dynamically (let's say by clicking a button). And also, how to do just the opposite. How to open a text box by clicking a button.
Thanks in advance,
Cameron
nikkiH
12-06-2006, 04:07 PM
That question doesn't really make sense.
You can use form.show method to show a form and form.hide method to close it (VB6). Buttons have a click method.
Also, please post versions when you ask coding questions. VB6, VB.NET 1.1, VB.NET 2.0 etc. :)
Goat Spirit
12-06-2006, 09:22 PM
I need to know how to close a form, (let's say a text box) dynamically (let's say by clicking a button). And also, how to do just the opposite. How to open a text box by clicking a button.
Thanks in advance,
Cameron
Hello.
In VB6 I am not sure but would probably be:
Text1.Visible = False
And vice versa, same coding for VB 2003.
oracleguy
12-06-2006, 09:58 PM
That question doesn't really make sense.
Yeah...
A form isn't the same thing as a textbox.
cameronlanni
12-07-2006, 04:56 AM
Sorry for the vagueness. I am using Visual Studio 2005. I am still new to VB, so I appologize. I will try the suggestions, but to clarify, I'm trying to make an entire text area (box and white background and all) disappear by button click. And also make an entire text area or text box appear (in a totally different spot on the form) by button click.
Here's the whole story: As some of you know, I'm making a text based RPG in Visual Basic. There is technically only one form throughout the whole game that I have to use and reuse again and again. I've had no problem making text appear or disappear by button click, but the dillema is this: On the first page, their is a text box that is there so the user can enter thier username. Then they click a "Continue" button, and all the text changes, but the text box is still there! So, I need to erase or remove the text box, and then create them later when I need input from the user.
Hope that clarifies everything a little more.
Thank you all!
Cameron
cameronlanni
12-07-2006, 05:03 AM
w00t!
'Text1.Visible = False' Worked!
I knew it was a simple fix! Well, I think I'll use the same code to show the text boxes/areas. I'll create them right on the form, but hide them right from the get-go, and then show them and hide them as i need them!
Thank you all so much!
Cameron
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.