|
-
Jul 8th, 2008, 10:17 PM
#1
Thread Starter
New Member
More Frames? Settings pop up
I made a Web Browser in Visual Basic 2008, and i want to know how to create a Pop up form (i guess thats what its called?) for the program options. like this one from Firefox :

I just need a simple one, not this elaborate.
even just the base code to make it appear blank or whatever.
And please, don't just type up a block of code, i like to know what I'm doing and what it all means. Ive only been doing this for a day.
-
Jul 9th, 2008, 01:15 AM
#2
Re: More Frames? Settings pop up
You will need to create yourself a second Windows form if this is a Windows application project. You can do this from the Project menu > Add form menu.
Once you have this, use the Solution Explorer and Toolbox windows to select this form and place the neccessary controls (buttons, labels, radio buttons etc.) onto the form. Both these menus should appear at the side of your Visual Studio window but if not they can be bought up from under the View menu in Visual Studio.
To show this secondary form, you must write some code into form1 in your case - perhaps from a button or menu click event on the form, which will perform the loading, and part of the display of the second form, like so:
Code:
' Declare a new variable (i.e. tell the .Net framework you
' are to require and shortly use a space in the computer's
' RAM large enough for a Windows Form data type).
Dim newForm2InstanceObject As Form2
' Instanciate the object - actually perform the creation of
' the new Form2 object from the Form2 class. This will set
' the variable to the new form2 object and populate the
' set-aside space in RAM.
newForm2InstanceObject = New Form2
' Display the instance of the form2 object by calling the .Show
' method upon the variable (newly instanciated Form2 object).
newForm2InstanceObject.Show()
-
Jul 9th, 2008, 01:21 AM
#3
Re: More Frames? Settings pop up
Note there is also a .ShowDialog method you can call as an alternative to the .Show method.
The difference between this is the 1st forces the 2nd form's instance to be on top of the form 1 instance (the option screen to appear over the top of the web browser screen). At all times. You cannot click the form1 instance, or more-properly "window", behind the form 2 instance and switch to it (to enter a different URL for example). An example of this would be the file open dialog box you see in Microsoft Office applications - try selecting File > Open in Microsoft Word, then try and enter some text or click the bold button whilst the open file selection dialog box is open - you won't be able to perform those operations as the dialog is modal.
With the .Show method, you can switch between the windows (form instances).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|