Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 25th, 2012, 02:01 AM
james dawson james dawson is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 3 james dawson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 7 sec
Reputation Power: 0
Help simple vb programing form

hi... i am doing a project on windows form application in vb.An example i have 2 windows form name Form1 and Form2 and each of them have a button name Button1. In the first forms button i put Form2.Show(), this will pop up Form2 in a new window

is it possible if i want Form2 to show in Form1 window?? Example, when i click on the button in Form1 it would switch to Form2 instead of poping out

thanks =D

Reply With Quote
  #2  
Old September 25th, 2012, 03:03 AM
couttsj couttsj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 178 couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level)couttsj User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 22 h 6 m 57 sec
Reputation Power: 43
I don't really understand your question. When you execute Form2.Show, it will load the window if it is not already loaded and then display it with the focus. If it is already loaded and displayed, it will shift the focus to Form2. If what you are after is to have Form2 displayed within the boundaries of Form2, you can adjust the size and location of any form using code. The only option you have is whether or not the form is displayed modal. A modal form will not return control to the calling form until it has been unloaded. For example, I would use a modal form to enter a password.

J.A. Coutts
Comments on this post
james dawson agrees!

Reply With Quote
  #3  
Old September 25th, 2012, 07:52 AM
debasisdas's Avatar
debasisdas debasisdas is offline
Humble Learner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Location: Bangalore, India
Posts: 279 debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3
Time spent in forums: 2 Months 3 Days 4 h 56 m 45 sec
Reputation Power: 118
Send a message via ICQ to debasisdas Send a message via AIM to debasisdas Send a message via Skype to debasisdas
try this

in the click event of Button 1 in form 1

Form2.Show()
me.hide

in the click event of Button 1 in form 2

Form1.Show()
me.hide
Comments on this post
james dawson agrees!

Reply With Quote
  #4  
Old September 25th, 2012, 03:22 PM
james dawson james dawson is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 3 james dawson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by couttsj
I don't really understand your question. When you execute Form2.Show, it will load the window if it is not already loaded and then display it with the focus. If it is already loaded and displayed, it will shift the focus to Form2. If what you are after is to have Form2 displayed within the boundaries of Form2, you can adjust the size and location of any form using code. The only option you have is whether or not the form is displayed modal. A modal form will not return control to the calling form until it has been unloaded. For example, I would use a modal form to enter a password.

J.A. Coutts

thanks for the reply.... but i m looking for the answer below.

Reply With Quote
  #5  
Old September 25th, 2012, 03:24 PM
james dawson james dawson is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 3 james dawson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by debasisdas
try this

in the click event of Button 1 in form 1

Form2.Show()
me.hide

in the click event of Button 1 in form 2

Form1.Show()
me.hide
thanks for the answer =D

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Help simple vb programing form

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap