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

Hosting Forms + events question

Hello

I have a main form that has a tab control. Each tab will host a form

So after creating each child form, I run the following code to attach it to
a tab

frm.Owner = this;
frm.TopLevel = false;
frm.WindowState = FormWindowState.Maximized;
frm.FormBorderStyle = FormBorderStyle.None;
tab.Controls.Add(frm);
frm.Dock = DockStyle.Fill;
frm.Show();

My question is how do I raise an event on the child form so that the main
form can react to this event. Specifically I want the main form to know if
the child form displayed is editing or browsing data

Thanks in advance
Darren
Nov 17 '05 #1
1 983
Hi,

I have never seen that approach, inserting a Form inside another Form, not
even sure if possible though. Usually you have one form and each tabpage has
controls but everything is inside the same form.

A possible solution is that the parent form declare a method that the child
forms can call whenever they need to inform a change of status, you would
have to pass a reference to this parent form in the constructors of the
child.
That the best suggestion I can think of right now
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Darren Guy" <da********@no.spam.idesk.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello

I have a main form that has a tab control. Each tab will host a form

So after creating each child form, I run the following code to attach it
to a tab

frm.Owner = this;
frm.TopLevel = false;
frm.WindowState = FormWindowState.Maximized;
frm.FormBorderStyle = FormBorderStyle.None;
tab.Controls.Add(frm);
frm.Dock = DockStyle.Fill;
frm.Show();

My question is how do I raise an event on the child form so that the main
form can react to this event. Specifically I want the main form to know if
the child form displayed is editing or browsing data

Thanks in advance
Darren

Nov 17 '05 #2

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

Similar topics

1
by: KK | last post by:
Windows Forms Inheritance, Incomplete? I was playing around with Windows Forms and found out this Forms Inheritance feature. The moment I saw that, I felt this can be used effectively if the...
2
by: Dave Bartlett | last post by:
I was wondering what most web hosting companies would think if I asked them to host a .NET executable application? Are they going to laugh me out the door, or can .NET code be suitably...
5
by: Shaul Dar | last post by:
Hi, I am looking for help with the following challenge. We are writing a Smart Client management application, which we want to appear to customers as a Web client. Hence we want to embed it...
0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
13
by: Bob | last post by:
My WinForms app runs on the single default thread, and uses a single SqlConnection object for all queries. I need to use one or more timers to periodically execute some of them. My own testing...
2
by: SteveW | last post by:
We have a native VC++ server application I'm planning on adding support to allow our customers to write synchronous event handlers using .NET. From my research it appears hosting the CLR using the...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...

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.