473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

launch a form from within another

How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should be a
way to do that
without the MDI form.
Nov 16 '05 #1
7 7753
Tammy,

FormName f = new FormName();
f.Show();

HTH,

//Andreas

"Tammy" <td***@thewavz. com> skrev i meddelandet
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should be a way to do that
without the MDI form.

Nov 16 '05 #2
Just create an instance of the form and show it;

eg: Form is called myForm.

MyForm myform2 = new MyForm();

myform2.Show();

or

myform2.ShowDia log();
-p

"Tammy" <td***@thewavz. com> wrote in message
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should be a way to do that
without the MDI form.

Nov 16 '05 #3
I was posting this question for a student.

The student is not asking how to load a from from another form. But, how to
load a form "inside" of another form. Not using MIDI. (The parent form
becomes the child form frame.)

"Tammy" <td***@thewavz. com> wrote in message
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should be a way to do that
without the MDI form.

Nov 16 '05 #4
You mean that the new form should be displayed inside the current form and
the current one shouldn't be an MDI one ? If so, I think you have to use
SetParent win32api. I don't think it would be directly possible in dotnet. I
don't see a use for it either.

Yves

"Tammy" <td***@thewavz. com> schreef in bericht
news:er******** ******@TK2MSFTN GP12.phx.gbl...
I was posting this question for a student.

The student is not asking how to load a from from another form. But, how to load a form "inside" of another form. Not using MIDI. (The parent form
becomes the child form frame.)

"Tammy" <td***@thewavz. com> wrote in message
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should
be a
way to do that
without the MDI form.


Nov 16 '05 #5
Tammy,

You will have to use the SetWindow API which is declared using C#
like this

public class Win32
{
private Win32()
{
}

[DllImport("user 32.dll", SetLastError=tr ue)]
public static extern IntPtr SetParent(
IntPtr childWindow, IntPtr newParent);
}

You would then use it like this (from inside a form) if you forexamples
wanted to open a form called ChildForm

ChildForm c = new ChildForm();
Win32.SetParent (c.Handle, this.Handle);
c.Show();

HTH,

//Andreas

"Tammy" <td***@thewavz. com> skrev i meddelandet
news:er******** ******@TK2MSFTN GP12.phx.gbl...
I was posting this question for a student.

The student is not asking how to load a from from another form. But, how to load a form "inside" of another form. Not using MIDI. (The parent form
becomes the child form frame.)

"Tammy" <td***@thewavz. com> wrote in message
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should
be a
way to do that
without the MDI form.


Nov 16 '05 #6
Phoeniz,

There is a good use for it and it is to host remote windows in your
own window for seamless integration. For example a plugin could provide
it's own configuration page which could be integrated into your applications
settings form. I do this in my extensibility framework and it is a very nice
way
to integrate functionality.

HTH,

//Andreas

"phoenix" <pa******@skyne tWORK.be> skrev i meddelandet
news:ut******** *****@TK2MSFTNG P11.phx.gbl...
You mean that the new form should be displayed inside the current form and
the current one shouldn't be an MDI one ? If so, I think you have to use
SetParent win32api. I don't think it would be directly possible in dotnet. I don't see a use for it either.

Yves

"Tammy" <td***@thewavz. com> schreef in bericht
news:er******** ******@TK2MSFTN GP12.phx.gbl...
I was posting this question for a student.

The student is not asking how to load a from from another form. But,
how to
load a form "inside" of another form. Not using MIDI. (The parent form
becomes the child form frame.)

"Tammy" <td***@thewavz. com> wrote in message
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there
should be
a
way to do that
without the MDI form.



Nov 16 '05 #7
// Play around with this format for a while and you'll find some intriguing
possibilities:

Form2 f2 = new Form2();
f2.TopLevel = false;
f2.Location = new Point( 100, 100 );
f2.FormBorderSt yle = FormBorderStyle .None;
f2.BackColor = SystemColors.Co ntrolDark;
this.Controls.A dd( f2 );
f2.Show();

Chris A.R.

"Tammy" <td***@thewavz. com> wrote in message
news:Od******** ******@TK2MSFTN GP09.phx.gbl...
How do I launch a form from within another?
The book I have only talks about MDI forms and I know that there should be a way to do that
without the MDI form.

Nov 16 '05 #8

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

Similar topics

7
404
by: Tammy | last post by:
How do I launch a form from within another? The book I have only talks about MDI forms and I know that there should be a way to do that without the MDI form.
5
32727
by: GrantS | last post by:
Hi I am trying to use ShellExecute to launch an application to display a certain file. The variation on the theme is that I need to be able to specify the application to launch and not simply pass the file name (which will then result in the application associated with the file extension to launch). I want to prevent the application registered in the system as being associated with the file extension from opeing the file.
7
2735
by: Christopher C | last post by:
I am using a C# winform to launch some apps for our students. Basically the user hits a button the form hides and the app is launched. When the app exits, the form is unhidden. I have a question on two things. From what I understand since I am starting the program from the Process.Start it is on a separate thread and this is really not a problem. Secondly what is the best way to work this form. Do I dispose of the form when I start the app...
3
1294
by: Kurt Skaronea | last post by:
I have a small standalone app that I would like to launch from a tools menu within another application. What is the best method for doing this? tia kurt
4
1455
by: VB User | last post by:
What is the best way in launching an imaging application from within the VB.Net application. I tried ShellExecute API and System.Diagnostics.ProcessStartInfo. VB.NET complains of security. What is the way out or is there a better method to launch another application from my Windows Forms Application?
1
1317
by: Ad | last post by:
It it possible to launch a windows form from within internet explorer? I need to keep this form on top of anything else, for which i can use the TopMost property of the form to achieve. Thanks
0
8438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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
8779
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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
4186
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
2765
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
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1761
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.