473,508 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bizzare me.close() problem

I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing
except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
Dim telephone As Boolean
Dim repname As String = Me.ComboBox1.Text.ToString
Dim rating As String = Me.ComboBox6.Text.ToString
If rating = "6. No Telephone" Then
telephone = False
Else
telephone = True
End If
Dim telchk As String = ComboBox5.Text.ToString
Dim yesno As String = "NULL"
Dim try1 As String = Me.Label16.Text.ToString
Dim try2 As String = Me.Label26.Text.ToString
Dim try3 As String = Me.Label19.Text.ToString
Dim councilrtb As String = Me.DateTimePicker1.Text.ToString
Dim team As String = Me.ComboBox4.Text.ToString
If telephone = True Then
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live")
Else
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live (No Tel)")
End If
Me.Close()
Nov 20 '05 #1
6 3580
Strange....or maybe not ?

I set up three tabs ( no events mind ) and put three buttons on, one on each
with me.Close() in it. only the first tab button will close the form.
Hmmmm....



"Mike Fellows" <mi*************@equityhouse.co.uk.SPAM> wrote in message
news:ys******************@newsfep1-win.server.ntli.net...
I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing
except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
Dim telephone As Boolean
Dim repname As String = Me.ComboBox1.Text.ToString
Dim rating As String = Me.ComboBox6.Text.ToString
If rating = "6. No Telephone" Then
telephone = False
Else
telephone = True
End If
Dim telchk As String = ComboBox5.Text.ToString
Dim yesno As String = "NULL"
Dim try1 As String = Me.Label16.Text.ToString
Dim try2 As String = Me.Label26.Text.ToString
Dim try3 As String = Me.Label19.Text.ToString
Dim councilrtb As String = Me.DateTimePicker1.Text.ToString
Dim team As String = Me.ComboBox4.Text.ToString
If telephone = True Then
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live")
Else
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live (No Tel)")
End If
Me.Close()

Nov 20 '05 #2
why not make a sub procedure containing the "shutdown instructions an
me.close" and then call it in whichever click event?

I do the same thing to keep from having redundant code, That way i can call
shutdown & close from wherever. Not sure if it is good or bad practice.
haven't tried this way, but if you make a shared procedure with me.close in
it couldn't you call that from any form?

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2***************@tk2msftngp13.phx.gbl...
Strange....or maybe not ?

I set up three tabs ( no events mind ) and put three buttons on, one on each with me.Close() in it. only the first tab button will close the form.
Hmmmm....



"Mike Fellows" <mi*************@equityhouse.co.uk.SPAM> wrote in message
news:ys******************@newsfep1-win.server.ntli.net...
I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing
except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
Dim telephone As Boolean
Dim repname As String = Me.ComboBox1.Text.ToString
Dim rating As String = Me.ComboBox6.Text.ToString
If rating = "6. No Telephone" Then
telephone = False
Else
telephone = True
End If
Dim telchk As String = ComboBox5.Text.ToString
Dim yesno As String = "NULL"
Dim try1 As String = Me.Label16.Text.ToString
Dim try2 As String = Me.Label26.Text.ToString
Dim try3 As String = Me.Label19.Text.ToString
Dim councilrtb As String = Me.DateTimePicker1.Text.ToString
Dim team As String = Me.ComboBox4.Text.ToString
If telephone = True Then
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live")
Else
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live (No Tel)")
End If
Me.Close()


Nov 20 '05 #3
TabPage1.FindForm.Close()

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2***************@tk2msftngp13.phx.gbl...
Strange....or maybe not ?

I set up three tabs ( no events mind ) and put three buttons on, one on each with me.Close() in it. only the first tab button will close the form.
Hmmmm....



"Mike Fellows" <mi*************@equityhouse.co.uk.SPAM> wrote in message
news:ys******************@newsfep1-win.server.ntli.net...
I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing
except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
Dim telephone As Boolean
Dim repname As String = Me.ComboBox1.Text.ToString
Dim rating As String = Me.ComboBox6.Text.ToString
If rating = "6. No Telephone" Then
telephone = False
Else
telephone = True
End If
Dim telchk As String = ComboBox5.Text.ToString
Dim yesno As String = "NULL"
Dim try1 As String = Me.Label16.Text.ToString
Dim try2 As String = Me.Label26.Text.ToString
Dim try3 As String = Me.Label19.Text.ToString
Dim councilrtb As String = Me.DateTimePicker1.Text.ToString
Dim team As String = Me.ComboBox4.Text.ToString
If telephone = True Then
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live")
Else
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3,
councilrtb, team, "Live (No Tel)")
End If
Me.Close()


Nov 20 '05 #4
Yes, thats true, cant deny it. But I'm still wondering why the me.close()
method does not close the form in any other tabs beside tab1 ?


"Jeff Brown" <no******@thistime.com> wrote in message
news:Oc*******************@twister.austin.rr.com.. .
why not make a sub procedure containing the "shutdown instructions an
me.close" and then call it in whichever click event?

I do the same thing to keep from having redundant code, That way i can call shutdown & close from wherever. Not sure if it is good or bad practice.
haven't tried this way, but if you make a shared procedure with me.close in it couldn't you call that from any form?

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2***************@tk2msftngp13.phx.gbl...
Strange....or maybe not ?

I set up three tabs ( no events mind ) and put three buttons on, one on

each
with me.Close() in it. only the first tab button will close the form.
Hmmmm....



"Mike Fellows" <mi*************@equityhouse.co.uk.SPAM> wrote in message
news:ys******************@newsfep1-win.server.ntli.net...
I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
Dim telephone As Boolean
Dim repname As String = Me.ComboBox1.Text.ToString
Dim rating As String = Me.ComboBox6.Text.ToString
If rating = "6. No Telephone" Then
telephone = False
Else
telephone = True
End If
Dim telchk As String = ComboBox5.Text.ToString
Dim yesno As String = "NULL"
Dim try1 As String = Me.Label16.Text.ToString
Dim try2 As String = Me.Label26.Text.ToString
Dim try3 As String = Me.Label19.Text.ToString
Dim councilrtb As String = Me.DateTimePicker1.Text.ToString
Dim team As String = Me.ComboBox4.Text.ToString
If telephone = True Then
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3, councilrtb, team, "Live")
Else
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3, councilrtb, team, "Live (No Tel)")
End If
Me.Close()



Nov 20 '05 #5
Hello,

"Mike Fellows" <mi*************@equityhouse.co.uk.SPAM> schrieb:
I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)


I am not able to repro that on Windows XP, .NET 1.1. Maybe this is
caused by the "close bug" in .NET 1.0. Which version of .NET do you
use?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6
Thanks Guys ive managed to get it sorted, its just bizarre how two of the
three worked and the other didnt
"Jeff Brown" <no******@thistime.com> wrote in message
news:Oc*******************@twister.austin.rr.com.. .
why not make a sub procedure containing the "shutdown instructions an
me.close" and then call it in whichever click event?

I do the same thing to keep from having redundant code, That way i can call shutdown & close from wherever. Not sure if it is good or bad practice.
haven't tried this way, but if you make a shared procedure with me.close in it couldn't you call that from any form?

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:%2***************@tk2msftngp13.phx.gbl...
Strange....or maybe not ?

I set up three tabs ( no events mind ) and put three buttons on, one on

each
with me.Close() in it. only the first tab button will close the form.
Hmmmm....



"Mike Fellows" <mi*************@equityhouse.co.uk.SPAM> wrote in message
news:ys******************@newsfep1-win.server.ntli.net...
I have a windows form with a tabcontrol on it

within each tabpage there is a button that does basically the same thing except with the difference of one variable

at the end of each of the button.click sub i run me.close()

me.close() works on 2 of the 3 buttons with no problems

on one of the forms it leaves the windows form open, even though when
debugging it is running the me.close command

here is my button click code (and me.close() is definatley executed)

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
Dim telephone As Boolean
Dim repname As String = Me.ComboBox1.Text.ToString
Dim rating As String = Me.ComboBox6.Text.ToString
If rating = "6. No Telephone" Then
telephone = False
Else
telephone = True
End If
Dim telchk As String = ComboBox5.Text.ToString
Dim yesno As String = "NULL"
Dim try1 As String = Me.Label16.Text.ToString
Dim try2 As String = Me.Label26.Text.ToString
Dim try3 As String = Me.Label19.Text.ToString
Dim councilrtb As String = Me.DateTimePicker1.Text.ToString
Dim team As String = Me.ComboBox4.Text.ToString
If telephone = True Then
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3, councilrtb, team, "Live")
Else
RaiseEvent MyEvent(repname, rating, telchk, yesno, try1, try2, try3, councilrtb, team, "Live (No Tel)")
End If
Me.Close()



Nov 20 '05 #7

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

Similar topics

15
5156
by: lawrence | last post by:
I wanted to test xml_parse_into_struct() so I took the example off of www.php.net and put this code up on a site: <?php $simple = <<<END <item>
1
2876
by: nick | last post by:
In the web site http://greywolfdesign.com , there is a pop-up menu (when mouse over 'Portfolio' menu item), it always works well when using IE (6). However, when using Mozilla 1.6, the popup...
18
1428
by: Richard Gutery | last post by:
I have an ASP page that I need to have a Message Box on. When I try to run the page, I get the following message : Exception Not Handled. Permission Denied. To trouble shoot, I gave everyone...
8
1172
by: BCC | last post by:
I am getting a non-reproduceable release mode only error, that is proving to be really a pain. I can in some cases narrow it down by try/catch blocks but even that behavior is totally f*ed up. ...
1
2257
by: Zri Man | last post by:
I have come across a bizzare behaviour with DB2/UDB 8.2 on SuSE Linux 2.41 When I have a MQT Refresh going on (complete refresh) it appears to lock the underlying base tables used to build the...
7
1897
by: Martin Pritchard | last post by:
Hi, Sorry for my ignorance, but I'm a bit new to C++. I've been handed over a C++ app written in VS2002 which I have to convert to VS2005. Apparently it's been written in a C style, but cannot...
2
1554
by: the.duckman | last post by:
G'Day, I have a simple peice of code behaving in a rather eratic manner. outputStreams = new MemoryStream(); //.... some code to add values to the stream ... bool ready = false; //.... some...
16
1122
by: Ben | last post by:
Hello...hopefully my last question :-) I ave a dictionary, where each value is a class instance. I access it using: for k, v in self.panels.panel_list.items(): print "Number:\t",v.number...
3
3589
by: PT | last post by:
Hi, I've a simple XML tree that is essentially. <?xml version="1.0"?> <Project> <Version Version="1.001" /> <Platform Name="Platform1"/> <Platform Name="Platform2" /> </Project>
0
7223
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,...
0
7115
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
7321
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,...
1
7036
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
7489
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
5624
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,...
0
4705
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.