473,396 Members | 2,115 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,396 software developers and data experts.

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 7738
Tammy,

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

HTH,

//Andreas

"Tammy" <td***@thewavz.com> skrev i meddelandet
news:Od**************@TK2MSFTNGP09.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.ShowDialog();
-p

"Tammy" <td***@thewavz.com> wrote in message
news:Od**************@TK2MSFTNGP09.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**************@TK2MSFTNGP09.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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP09.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("user32.dll", SetLastError=true)]
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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP09.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******@skynetWORK.be> skrev i meddelandet
news:ut*************@TK2MSFTNGP11.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**************@TK2MSFTNGP12.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**************@TK2MSFTNGP09.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.FormBorderStyle = FormBorderStyle.None;
f2.BackColor = SystemColors.ControlDark;
this.Controls.Add( f2 );
f2.Show();

Chris A.R.

"Tammy" <td***@thewavz.com> wrote in message
news:Od**************@TK2MSFTNGP09.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
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
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...
7
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...
3
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
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...
1
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...
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...
0
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...
0
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...

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.