473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form inside a form

I have two windows forms in an application. I want one form to be embedded
into the other. How can this be done? Can I do something like:

Form1.Controls. Add(Form2);

Thanks.
Jess
Feb 15 '06 #1
3 2913
You can go the MDI route if that makes sense in your application - you have
a main Form that hosts multiple "documents" . Otherwise, literally embedded a
Form onto another Form as if it were a control can be done; however, are you
sure you don't want to build a container control, like a UserControl, and
then place instances of this control on the Form?
http://groups.google.com/group/micro...75d20fdf3ce25b

--
Tim Wilson
..NET Compact Framework MVP

"Jessica Weiner" <je*****@gmail. com> wrote in message
news:mj******** ***********@new ssvr11.news.pro digy.com...
I have two windows forms in an application. I want one form to be embedded
into the other. How can this be done? Can I do something like:

Form1.Controls. Add(Form2);

Thanks.
Jess

Feb 15 '06 #2
Tim Wilson wrote:
You can go the MDI route if that makes sense in your application -
you have a main Form that hosts multiple "documents" . Otherwise,
literally embedded a Form onto another Form as if it were a control
can be done; however, are you sure you don't want to build a
container control, like a UserControl, and then place instances of
this control on the Form?


I looked into Mdi and it was exactly what I needed. Thanks, that was very
helpful.

Jess
Feb 15 '06 #3
Hi,

"Jessica Weiner" <je*****@gmail. com> wrote in message
news:%k******** ***********@new ssvr29.news.pro digy.net...
Tim Wilson wrote:
You can go the MDI route if that makes sense in your application -
you have a main Form that hosts multiple "documents" . Otherwise,
literally embedded a Form onto another Form as if it were a control
can be done; however, are you sure you don't want to build a
container control, like a UserControl, and then place instances of
this control on the Form?


I looked into Mdi and it was exactly what I needed. Thanks, that was very
helpful.


Note that MDI is intended for a window to "potentiall y" contain more than
one window, if you always will have a single window inside you would go
better transforming the second form in a usercontrol or a panel

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 15 '06 #4

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

Similar topics

8
7152
by: L Major | last post by:
Hi Unfortunately, I am limited to using tables for part of my current project. I have a form that spans across a number of TR and TD in the shape of checkboxes. Doctype is XHTML 1.0 Transitional, Encoding is utf-8 Is there anything wrong? Should I try something else? What in that case?
2
2911
by: Asad | last post by:
I have a form on a page that has several textareas, and textboxes inside a table (so the table containing the textboxes is also inside the FORM tag). I want to replace the textareas with simple text instead. But I want to keep the format of my page EXACTLY the same. However, the problem is that ... 1) Javascript won't let me create say a one-cell TABLE containing some text (e.g. textarea's value) and then insertBefore an element in the
1
3222
by: ray well | last post by:
hi, i need to preview the keys in my app in order to process F1-F10. i set keypreview of my form to true, and it does capture the keystrokes from all over the forms controls which i then process. i found 2 puzzeling exception: if the user is inside the text box of a ComboBox, the keystrokes aren't captured in the form's keypress event. i have to separately capture the
4
14480
by: athlonman | last post by:
Hi all!! II'm trying to set the Text of a TextBox in "Form1" when I click a Button in a UserControl. My code is: : public class Form1 : System.Windows.Forms.Form { public System.Windows.Forms.TextBox textBox1; private WindowsApplication1.UserControl1 userControl11;
3
4046
by: Roger | last post by:
Hi In a Windows forms application I have 2 forms A and B; Form B inherits from form A. Form A is never displayed and its only purpose is to be inherited from and therefore contains mostly public/protected methods that I have created (as well a few controls that inheriting forms may use). In my method on form A (public virtual void setcontrols()) I need a list of all controls on the instantiated form (in this example form B). Form B has a...
4
9957
by: Matthew Louden | last post by:
It happend to me more than once. When I create web controls or move the positions in VS.NET, I encountered the following run-time errors: It doesn't matter what controls I create, the following 'checkbox' control is just an example. Control 'CheckBox1' of type 'CheckBox' must be placed inside a form tag with runat=server. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
2
1505
by: Neo Geshel | last post by:
After pouring over about a dozen sites that clearly dealt with ClientID all by itself, I came to the realization that about 2/3+ of them were doing it wrong. It is indeed impossible to grab the Client ID of a form field from within a DataGrid like this: <%= FormFieldID.ClientID %>. At least, not without extra work. How did I do this? I created a new DataGrid from scratch, with a form above it and a form inside of it. This was a page...
19
1964
by: hamil | last post by:
I have a form with one button, Button1, and a Textbox, Textbox1 I have a class, class1 as follows. Public Class Class1 Public DeForm As Object Sub doit() DeForm.Textbox1.text = "It works" End Sub End Class
4
5524
by: Daniel R. Rossnagel | last post by:
As I can hide the bar of I title of a window daughter maximized within form MDI Already I have proven with different types from borders, hiding thebuttons to maximize, to diminish and control box, but nothing... If somebody can help me I'm thanked Daniel R. Rossnagel
4
13325
by: Alex Maghen | last post by:
I have a master page which contains a general page framework and also contains a <form runat=server> around most of the content of the page. Inside that <form> tag is a ContentPlaceholder. I then create an ASPX which is tied to that MasterPage and in it a put a bunch of form fields and an <asp:Button />. When I try to run the page, I get... "Control 'ctl00_BodyCPH_ctl00' of type 'Button' must be placed inside a form tag with...
0
8683
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
9170
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...
1
8901
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
8871
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...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
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();...
1
3052
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
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.