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

Home Posts Topics Members FAQ

mdi with and childform closing

I can open several childforms with the following sub in de mdi form after
clicking a button

Private Sub NewWindow()

Dim ch As New ChildForm()
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

end sub

I want to open automatically a new childform when the last childform is
closed or closing.

I have tried with a event but changing the line in the sub in <dim
Withevents
ch as new Childform()> fails.

Thanks for any response.

Nov 20 '05 #1
6 1599
"andreas" <an*****@pandor a.be> schrieb
I can open several childforms with the following sub in de mdi form
after clicking a button

Private Sub NewWindow()

Dim ch As New ChildForm()
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

end sub

I want to open automatically a new childform when the last childform
is closed or closing.

I have tried with a event but changing the line in the sub in <dim
Withevents
ch as new Childform()> fails.


Withevents can only be used at class level because it internally adds
properties to the class. Properties can only be at class level, not a
procedure level. Use Addhandler/RemoveHandler instead.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
"andreas" <an*****@pandor a.be> schrieb
I can open several childforms with the following sub in de mdi form
after clicking a button

Private Sub NewWindow()

Dim ch As New ChildForm()
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

end sub

I want to open automatically a new childform when the last childform
is closed or closing.

I have tried with a event but changing the line in the sub in <dim
Withevents
ch as new Childform()> fails.


Withevents can only be used at class level because it internally adds
properties to the class. Properties can only be at class level, not a
procedure level. Use Addhandler/RemoveHandler instead.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Thanks for the information.
I tried addhandler/removehandler but has no solution.
Who gives me a sample code ?
F.e. after closing a child let run a sub in the parent form

"Armin Zingler" <az*******@free net.de> schreef in bericht
news:40******** *************** @news.freenet.d e...
"andreas" <an*****@pandor a.be> schrieb
I can open several childforms with the following sub in de mdi form
after clicking a button

Private Sub NewWindow()

Dim ch As New ChildForm()
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

end sub

I want to open automatically a new childform when the last childform
is closed or closing.

I have tried with a event but changing the line in the sub in <dim
Withevents
ch as new Childform()> fails.


Withevents can only be used at class level because it internally adds
properties to the class. Properties can only be at class level, not a
procedure level. Use Addhandler/RemoveHandler instead.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
Thanks for the information.
I tried addhandler/removehandler but has no solution.
Who gives me a sample code ?
F.e. after closing a child let run a sub in the parent form

"Armin Zingler" <az*******@free net.de> schreef in bericht
news:40******** *************** @news.freenet.d e...
"andreas" <an*****@pandor a.be> schrieb
I can open several childforms with the following sub in de mdi form
after clicking a button

Private Sub NewWindow()

Dim ch As New ChildForm()
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

end sub

I want to open automatically a new childform when the last childform
is closed or closing.

I have tried with a event but changing the line in the sub in <dim
Withevents
ch as new Childform()> fails.


Withevents can only be used at class level because it internally adds
properties to the class. Properties can only be at class level, not a
procedure level. Use Addhandler/RemoveHandler instead.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
"andreas" <an*****@pandor a.be> schrieb
Thanks for the information.
I tried addhandler/removehandler but has no solution.
Who gives me a sample code ?
Dim ch As New ChildForm()
addhandler ch.closed, addressof onchildformclos ed
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

private sub onchildformclos ed(...)
removehandler (directcast(sen der, form)).closed, _
addressof onchildformclos ed
'open another form as written in your first post F.e. after closing a child let run a sub in the parent form

'this can also be done here
end sub

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
"andreas" <an*****@pandor a.be> schrieb
Thanks for the information.
I tried addhandler/removehandler but has no solution.
Who gives me a sample code ?
Dim ch As New ChildForm()
addhandler ch.closed, addressof onchildformclos ed
ch.MdiParent = Me
ch.Text = "Textwindow nr " & Me.MdiChildren. Length.ToString
ch.Show()

private sub onchildformclos ed(...)
removehandler (directcast(sen der, form)).closed, _
addressof onchildformclos ed
'open another form as written in your first post F.e. after closing a child let run a sub in the parent form

'this can also be done here
end sub

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7

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

Similar topics

0
1007
by: Jeff | last post by:
IDE: Visual Studio 2003 .NET OS: Xp pro I'm wondering is it possible in visual studio to create childforms with layout like the Solution Explorer in VS? More specific: What is the setting in tab-controll, that place the tabs at the buttom??
6
5659
by: Al the programmer | last post by:
I want to catch the Closing event for my form. I created a test windows app using the wizard. I then create the Closing event by clicking the lightning bolt on the properties pane. The code is added to the app but my app won't compile. It generates a "Test.Form1.Closing() denotes a 'method' which is not valid in the given context" error.
2
1919
by: andreas | last post by:
I have a program with a mdiform and same childforms (with a textbox) that i open. All works fine. In the childform i open another form (for finding and replacing). In a sub in that form i try to write there mdiform.activechildform.textbox.text but that fails because activechildform should not be a member of mdiform. I don't see why. The goal is to reach the textbox of the active childform. For those who has the book form Evangelos...
6
850
by: andreas | last post by:
I can open several childforms with the following sub in de mdi form after clicking a button Private Sub NewWindow() Dim ch As New ChildForm() ch.MdiParent = Me ch.Text = "Textwindow nr " & Me.MdiChildren.Length.ToString ch.Show()
10
4017
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
1
2709
by: Rich | last post by:
Hello, I have a child form in a parent MDI form. The childform is being shrunk and cannot be resized when screen resolution is 800x600. The end user who uses my app cannot see stuff on the screen too well if the resolution is smaller than 800x600 (why did it have to be my app?) Yes, I know, get a bigger screen - $$. Management is on it - just not right now. The parent form can be resized but not the child form. What is the way...
2
1092
by: Michael | last post by:
if i open the connection of datbase in the parentForm, i want to read table from ChildForm, but it show blank; how do i do?
3
4306
by: Peted | last post by:
I have a simple c# app that opens a child form in a mdi parent. I want the child form to open in the center of the mdi parent, so i can open the child form ok, it all works fine, but setting frmConfig = new ConfigForm(this); frmConfig.MdiParent = this; frmConfig.TopLevel = false; frmConfig.StartPosition = FormStartPosition.CenterParent;
0
1224
by: thesti | last post by:
hello, i have some labels in my MDIParent form, they are greeting labels for the logged in user. when i open a childform, the labels cover the opened childform, while actually i expect that the labels will be covered by the childform. can i bring the childform to front, or is there any way to get the labels covered by the childform? Thank you.
0
8609
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
9169
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
8899
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
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
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();...
0
4371
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
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
2335
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.