[urgent] MsgBox is non-modal.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • js

    #1

    [urgent] MsgBox is non-modal.

    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 ApplicationModa l MsgBoxStyle were all tried and there
    was no help.



    -jason







  • Peter van der Goes

    #2
    Re: [urgent] MsgBox is non-modal.


    "js" <jason@nospam.c om> wrote in message
    news:e9lttlcsDH A.556@TK2MSFTNG P11.phx.gbl...[color=blue]
    > Hi all,
    >
    > I currently encounter a problem and it is urgent to me.
    >
    > After calling the MsgBox.Show(), the message box is shown with[/color]
    non-modal[color=blue]
    > mode, what is the possible reason??? This only happen in the VB project,
    > works fine in C# project.
    >
    > SystemModal and ApplicationModa l MsgBoxStyle were all tried and there
    > was no help.
    >
    >
    >
    > -jason
    >[/color]
    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]


    Comment

    • js

      #3
      Re: [urgent] MsgBox is non-modal.

      A similiar thread with more details was posted under
      ....dotnet.fram ework.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" <jason@nospam.c om> wrote in message
      news:%23YkBd%23 lsDHA.424@TK2MS FTNGP11.phx.gbl ...[color=blue]
      > 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[/color]
      believe[color=blue]
      > has the similar window relationship as the DateTimePicker control. My
      > customer reported the non-modal problem to me and I immediately checked[/color]
      the[color=blue]
      > DateTimePicker, "luckily" it has the same problem.
      >
      > I was trying to work around it but with no result, whatever both the
      > MsgBoxStyle.Sys temModal and the MsgBoxStyle.App licationModal 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" <THISWILLBOUNCE newsgroups@thed atafarm.com> wrote in message
      > news:O8gyuojsDH A.3532@TK2MSFTN GP11.phx.gbl...[color=green]
      > > 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[/color]
      > modal[color=green]
      > > 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" <jason@nospam.c om> wrote in message
      > > news:u4KDxSdsDH A.3224@tk2msftn gp13.phx.gbl...[color=darkred]
      > > > 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[/color][/color][/color]
      a[color=blue][color=green][color=darkred]
      > > > message box in the ValueChanged event, as below snippet. Now run the[/color][/color]
      > form[color=green][color=darkred]
      > > > and drop down the calendar, select a date to let the event fire, after[/color][/color]
      > the[color=green][color=darkred]
      > > > message box shown, we can still activate the form background. This[/color][/color]
      > happens[color=green][color=darkred]
      > > > whatever MsgBoxStyle is specified even as MsgBoxStyle.Sys temModal.
      > > >
      > > >
      > > > Private Sub DateTimePicker1 _ValueChanged(B yVal sender As Object,[/color][/color]
      > ByVal[color=green]
      > > e[color=darkred]
      > > > As System.EventArg s) Handles DateTimePicker1 .ValueChanged
      > > > MsgBox("DateTim ePicker1_ValueC hanged",[/color]
      > > MsgBoxStyle.App licationModal)[color=darkred]
      > > > End Sub
      > > >
      > > >
      > > > The same scenario could be reproduced in a C# project, but I could[/color][/color][/color]
      pass[color=blue]
      > it[color=green][color=darkred]
      > > > if by specifying the Form as the owner of the message box, as below[/color][/color]
      > code.[color=green][color=darkred]
      > > >
      > > > private void dateTimePicker1 _ValueChanged(o bject sender,[/color]
      > > System.EventArg s[color=darkred]
      > > > e)
      > > > {
      > > > MessageBox.Show (this, "dateTimePicker 1_ValueChanged" );
      > > > }
      > > >
      > > >
      > > >
      > > > Is something wrong in the message box method in VB?
      > > >
      > > >
      > > >
      > > >
      > > > -jason[/color][/color][/color]






      "Peter van der Goes" <p_vandergoes@m ars.cox.net> wrote in message
      news:#j8Gt0hsDH A.3140@TK2MSFTN GP11.phx.gbl...[color=blue]
      >
      > "js" <jason@nospam.c om> wrote in message
      > news:e9lttlcsDH A.556@TK2MSFTNG P11.phx.gbl...[color=green]
      > > Hi all,
      > >
      > > I currently encounter a problem and it is urgent to me.
      > >
      > > After calling the MsgBox.Show(), the message box is shown with[/color]
      > non-modal[color=green]
      > > mode, what is the possible reason??? This only happen in the VB project,
      > > works fine in C# project.
      > >
      > > SystemModal and ApplicationModa l MsgBoxStyle were all tried and[/color][/color]
      there[color=blue][color=green]
      > > was no help.
      > >
      > >
      > >
      > > -jason
      > >[/color]
      > 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]
      >
      >[/color]


      Comment

      Working...