473,602 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1700
* 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 LoadFormIntoPan el()
Dim MyForm2 as New Form2
MyForm2.Size = pnlContent.Size
MyForm2.TopLeve l = 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
2005
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 did was: In an empty form, I set the Form1.Text to "0" and added the following code for Form1.MouseMove event.
4
1550
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 app. It multi-form app that takes in a lot of user input and gives out high end calculations (engineering app). This app is starting to grow beyond the design and becoming very hard to maintian. I was considering moving it to C#. All of our new...
1
2693
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 familiar with its intricacies, so I'm getting a bunch of errors on certain scenarios. The code below works fine but breaks if I click on Button1 a few times without moving the program window ----------
3
3024
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 MouseHover event. To get a Mousehover I must leave and reenter the control. I'd like to get an event each time the cursor stops moving.
2
3101
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 connecting the two shapes. http://www.blackwaterbadgers.co.uk/image1.bmp Image 1 shows how if you have a line between two shapes, the line is straight. if you have more than one line, the lines will start overlapping
3
2677
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 what is the best way to give the object boundries to move within? Hope someone can help me. TIA, Arjan. /*Begin Code*/
14
2000
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 some code in the FormLoad procedure which works out the centre of the screen and moves the child appropraitely. This is pretty much the code I have:
0
1271
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 to know how much data i will get back and its a complicated process. So i decided to use a dummy progress bar, that is 5 moving dots, Which in turn gives user feeling of some progress happening. But if i comment the actual getting data part...
8
2854
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 elements of VB.net....so that you were confident to write a application from scratch. This wouldnt necessarily
0
1041
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 untyped Dataset, containing one table. In the designer for the inherited forms, I then add specific columns and other tables to the inherited dataset. This does not work in VS 2005 anymore, because the Tables property of the dataset in the inherited...
0
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.