473,386 Members | 1,712 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,386 software developers and data experts.

[urgent] MsgBox is non-modal.

js
Hi all,

I currently encounter a problem and it is urgent to me.

After calling the MsgBox.Show(), the message box is shown with non-modal
mode, what is the possible reason??? This only happen in the VB project,
works fine in C# project.

SystemModal and ApplicationModal MsgBoxStyle were all tried and there
was no help.

-jason



Jul 21 '05 #1
2 5951

"js" <ja***@nospam.com> wrote in message
news:e9*************@TK2MSFTNGP11.phx.gbl...
Hi all,

I currently encounter a problem and it is urgent to me.

After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen in the VB project,
works fine in C# project.

SystemModal and ApplicationModal MsgBoxStyle were all tried and there
was no help.

-jason

Please show the code and circumstances. The default behavior of
MessageBox.Show() is to produce an application model message box, IME. I
also tested MsgBox() without incident. It, too, seems to default to
application modal.

--
Peter - [MVP - .NET Academic]
Jul 21 '05 #2
js
A similiar thread with more details was posted under
....dotnet.framework.winform group, below contains some useful information
that may help.

I also made a very simple usercontrol which could produce the problem,
please let me know if you need it.

-jason

--julie wrote--------

I have put the question in as a possible bug.
Will post back as soon as I have some info for you.
I have seen other issues posted about the valuechanged event and msgbox.
julie

"js" <ja***@nospam.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
Julie,

Yes, only the DateTimePicker has the issue. The reason I just choose
this control is I was constructing a custom dropdown control which I believe has the similar window relationship as the DateTimePicker control. My
customer reported the non-modal problem to me and I immediately checked the DateTimePicker, "luckily" it has the same problem.

I was trying to work around it but with no result, whatever both the
MsgBoxStyle.SystemModal and the MsgBoxStyle.ApplicationModal do not take
effect in this scenario. I have no idea whether this is a bug in the .NET
Framework.

Any .NET MVP could help?

-jason

"Julia Lerman" <TH**********************@thedatafarm.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
Jason
You are partially right. I tried the datetimepicker and a few other
controls. So far it is only the date time picker that is ignoring the modal
state of the dialog box. Try a checkbox and put your msgbox in the
checkedChanged event or a button with a msgbox in the click event.

I could not find any info on this via google.

I will ask some more MVP's if they are familiar with this problem.

Julie Lerman
.NET MVP

"js" <ja***@nospam.com> wrote in message
news:u4**************@tk2msftngp13.phx.gbl...
Hi,

In some situation, the message box can not be shown in modal mode.

Please drop a DateTimePicker control on a Form (VB project), show a message box in the ValueChanged event, as below snippet. Now run the form and drop down the calendar, select a date to let the event fire, after the message box shown, we can still activate the form background. This happens whatever MsgBoxStyle is specified even as MsgBoxStyle.SystemModal.
Private Sub DateTimePicker1_ValueChanged(ByVal sender As Object, ByVal
e
As System.EventArgs) Handles DateTimePicker1.ValueChanged
MsgBox("DateTimePicker1_ValueChanged",

MsgBoxStyle.ApplicationModal)
End Sub
The same scenario could be reproduced in a C# project, but I could
pass it if by specifying the Form as the owner of the message box, as below code.
private void dateTimePicker1_ValueChanged(object sender, System.EventArgs
e)
{
MessageBox.Show(this, "dateTimePicker1_ValueChanged");
}

Is something wrong in the message box method in VB?


-jason



"Peter van der Goes" <p_**********@mars.cox.net> wrote in message
news:#j**************@TK2MSFTNGP11.phx.gbl...
"js" <ja***@nospam.com> wrote in message
news:e9*************@TK2MSFTNGP11.phx.gbl...
Hi all,

I currently encounter a problem and it is urgent to me.

After calling the MsgBox.Show(), the message box is shown with

non-modal
mode, what is the possible reason??? This only happen in the VB project,
works fine in C# project.

SystemModal and ApplicationModal MsgBoxStyle were all tried and

there was no help.

-jason

Please show the code and circumstances. The default behavior of
MessageBox.Show() is to produce an application model message box, IME. I
also tested MsgBox() without incident. It, too, seems to default to
application modal.

--
Peter - [MVP - .NET Academic]

Jul 21 '05 #3

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

Similar topics

1
by: Doolittle | last post by:
Hi, I'm a relatively new VBA programmer but have been given the task of repairing a database that currently appears with "3146 ODBC--call failed." This happens when various criteria are input into...
3
by: Phoebe. | last post by:
Hi, Good Day! I need to display a msgbox asking user whether to delete a record or not using javascript. It works fine. Later on user request to add in more info in that msgbox, displaying...
1
by: srinivas | last post by:
Hi, i'm trying to retreive the appointments from different profiles of outlook. My outlook has 3 profiles created.('Sample1','Sample2','Sample3') my form contains 3 buttons.each one for each...
2
by: Xeijin | last post by:
URGENT I have an assignment to hand in tomorrow, I need to know how to perform numeric calculations in access, I dont know very much about databases so consider this a beginner's query! Well...
5
by: mrid via DotNetMonster.com | last post by:
hi. im exporting data from a vb form to excel. i am able to create a new excel file, save and edit it without any trouble, but the formatting is giving me hell! i need to be able to show certain...
4
by: kumar_ps | last post by:
i am new for vb6.0. i am using vb6.0 and msaccess. i have written following code for add new records to database table Private Sub Command1_Click() On Error Resume Next If Trim(Text2.Text) =...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
2
by: kumar_ps | last post by:
Private Sub Command1_Click() On Error Resume Next If Trim(Text3.Text) = Trim(Text4.Text) Then rs.MoveFirst While Not rs.EOF If (Trim(Text1.Text) <> Trim(rs.Fields(0))) And...
77
by: Hans Schneider | last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); }
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...

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.