473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Moving between forms in VB.NET

Ok, I am a newbee at vb.net and I have written an application with
multiple forms. I have created a form named frmbase with all other
forms are inherited from. frmbase has my menu on it. I have set
frmbase as the startup form. This all works great, however when I go
to form 2 I get a new window, and I would like for it to stay in the
same window that frmBase was in so I don't have lots of windows open
as a user is working.

Can someone point in the right direction to do this?

Thanks
Nov 20 '05 #1
4 1691
* st******@gapac.com (Steven Thomas) scripsit:
Ok, I am a newbee at vb.net and I have written an application with
multiple forms. I have created a form named frmbase with all other
forms are inherited from. frmbase has my menu on it. I have set
frmbase as the startup form. This all works great, however when I go
to form 2 I get a new window, and I would like for it to stay in the
same window that frmBase was in so I don't have lots of windows open
as a user is working.


Instead of designing forms, design usercontrols that are dynamically
instantiated/removed from the form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Sounds good but I have about 20 forms built and working. Is there not a
better way to do this? If not is there and easy way to covert my forms
to controls?

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3
On Wed, 16 Jun 2004 09:26:19 -0700, Steven Thomas wrote:
Sounds good but I have about 20 forms built and working. Is there not a
better way to do this? If not is there and easy way to covert my forms
to controls?


One method is to open the forms inside the main form. In the main form,
add a panel to hold the other forms.

For each of the other forms, set their border style to None.

Then to load the form into the panel, do something like this (check syntax)

Private Sub LoadFormIntoPanel()
Dim MyForm2 as New Form2
MyForm2.Size = pnlContent.Size
MyForm2.TopLevel = False
MyForm2.Parent = pnlContent
MyForm2.Show
End Sub

This code will show the form inside the panel. Be sure that, as you load
and unload forms, you dispose of them properly, etc.

This should give you some ideas. I don't know if it's better, but you wont
have to change your forms.

--
Chris

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 20 '05 #4
Chris
Thanks for then info. It seems simple enough. However I got the
first form to load in the panel. Then how do I close it and load the
second. I don't seem to be able to determine which form is loaded and
how to close it?
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sam Sungshik Kong | last post by:
Hello! If I understand correctly, MouseMove event is triggered when the mouse moves (ie when point changes). I, however, found out that it's triggered even if the mouse is not moving. What I...
4
by: Ron Mexico | last post by:
Hi, Currently have an app that maintain that is written in VB6 and uses an access db (backend db only used as a data store not writing to the db). This app is a client app not server multi-teir...
1
by: siliconpi | last post by:
I'm looking for the simplest and cleanest way of having 10 buttons on a form, on which if I move my mouse over, a label's text changes as specified. I'm using Visual Basic .NET and I'm not too...
3
by: Just Me | last post by:
If I move the mouse cursor over a control and stop moving I get a MouseHover event. If I then move the cursor while staying within the control and then stop moving I do not get another...
2
by: Carl Gilbert | last post by:
Hi I have a math kinda problem where I'm trying to split some lines when two or more lines connect two shapes. The reason I am doing this is to make it clear that there are multiple lines...
3
by: AM Hulshoff | last post by:
Can someone tell me how I can move an object, in this case a listbox, over a form. The code below works, but not when the form is custom sized. It works perfectly when the form is maximized. And...
14
by: bwadley | last post by:
Hi, Im fairly new to VB.NET and am hoping someone can help me with what is probably a simple problem. I have an MDI app, when I open a child form, I want it centered to the parent. So I put...
0
by: Nishanthmarathe | last post by:
Hi There!!! I am new to C# world. I am getting huge chunk of data from a 3rd party applications thru SOAP request and updating to my SQL Server. I cant implement Progress bar as there is no way...
8
by: Chris Asaipillai | last post by:
Hi there I have some questions for those experienced Visual Basic 6 programmers out there who have made the transition from VB6 to Vb.net. How long did it take you to learn at least the basic...
0
by: Ed Sonneveld | last post by:
I am moving some of my VS 2003 projects to VS 2005. In my base library there is a baseform that is inherited by most forms in my application. The baseform in the library contains a protected...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.