Menu shortcut keys do not work when Form.Show is called.

  • Thread starter Thread starter Ken Varn
  • Start date Start date
K

Ken Varn

I have a form that I build in C# that does not seem to annunciate a menu
item selection when a shortcut key is pressed. It only seems to occur if I
display the form using the Form.Show() method. The problem does not seem to
occur when I use Form.ShowDialog().

Can someone explain how I can get around this problem?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
(e-mail address removed)
-----------------------------------
 
Thank you for your detailed information. It seems that there are some
problems of interoperation between C# DLL and managed C++ application.

Please try to create a window with mainmenu attached by shortkeys with
managed C++ in a DLL and then show the window in DLL from a managed C++
application to see if the issue remains.

Thank you.

Regards,
Justin Wan
Microsoft Partner Online Support

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
::Reply-To: "Ken Varn" <[email protected]>
::From: "Ken Varn" <[email protected]>
::References: <[email protected]>
<[email protected]>
::Subject: Re: Menu shortcut keys do not work when Form.Show is called.
::Date: Mon, 14 Jul 2003 09:13:04 -0400
::Lines: 84
::Organization: Diebold Inc.
::X-Priority: 3
::X-MSMail-Priority: Normal
::X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
::X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
::Message-ID: <[email protected]>
::Newsgroups: microsoft.public.dotnet.framework.windowsforms
::NNTP-Posting-Host: 204.151.249.23
::Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!tk2msftngp13.phx.gbl
::Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:48254
::X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
::
::I have a managed C++ MFC windows application that is displaying a .NET
::windows form that is contained in a C# DLL. The C++ application displays
::the C# form using the Show method. The C# windows form has a main menu
::where some menu items have shortcut keys. When I press the shortcut key,
::the menu item is not selected.
::
::However, I have another C# application that displays the same windows form
::that is in the C# dll mentioned above. The only difference is that the C#
::application displays the form using the ShowDialog() method. When this is
::done, the shortcut keys on the menu work fine.
::
::I tried to make a C# application show the dialog using the Show method and
::that also seems to work fine. Not sure why the C++ application is having
::problems.
::
::--
::-----------------------------------
::Ken Varn
::Senior Software Engineer
::Diebold Inc.
::[email protected]
::-----------------------------------
::::> Hello Ken,
::>
::> I am not quite clear about your description. Which form's menu will not
::> work as expected, the main form or the child form which is shown by the
::> main form.
::>
::> Would you provide a clear repro steps with which I will fully understand
::> what is the problem.
::>
::> Thank you!
::>
::> Regards,
::> Justin Wan
::> Microsoft Partner Online Support
::>
::> This posting is provided "AS IS" with no warranties, and confers no
::rights.
::> --------------------
::> ::Reply-To: "Ken Varn" <[email protected]>
::> ::From: "Ken Varn" <[email protected]>
::> ::Subject: Menu shortcut keys do not work when Form.Show is called.
::> ::Date: Fri, 11 Jul 2003 11:13:06 -0400
::> ::Lines: 16
::> ::Organization: Diebold Inc.
::> ::X-Priority: 3
::> ::X-MSMail-Priority: Normal
::> ::X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
::> ::X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
::> ::Message-ID: <[email protected]>
::> ::Newsgroups: microsoft.public.dotnet.framework.windowsforms
::> ::NNTP-Posting-Host: 204.151.249.23
::> ::Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
::> ::Xref: cpmsftngxa06.phx.gbl
::> microsoft.public.dotnet.framework.windowsforms:48154
::> ::X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
::> ::
::> ::I have a form that I build in C# that does not seem to annunciate a
menu
::> ::item selection when a shortcut key is pressed. It only seems to occur
::if
::> I
::> ::display the form using the Form.Show() method. The problem does not
::seem
::> to
::> ::occur when I use Form.ShowDialog().
::> ::
::> ::Can someone explain how I can get around this problem?
::> ::
::> ::--
::> ::-----------------------------------
::> ::Ken Varn
::> ::Senior Software Engineer
::> ::Diebold Inc.
::> ::[email protected]
::> ::-----------------------------------
::> ::
::> ::
::> ::
::>
::
::
::
 
Is there any other workaround besides converting my C# DLL to a C++ DLL?
Converting to a C++ DLL would be very impractical.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
(e-mail address removed)
-----------------------------------
 
Based on my knowledgment, there is no a tool which can autotamatically
convert a C# DLL to a C++ DLL.

In fact, in the case we focus on the the interop between C# code and C++
code. Although we can convert C# dll to a C++ DLL, we cannot guarantee the
DLL behaves as the DLL written manually in C++. Many converting tool is
based on function not code.

Regards,
Justin Wan
Microsoft Partner Online Support

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
::Reply-To: "Ken Varn" <[email protected]>
::From: "Ken Varn" <[email protected]>
::References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
::Subject: Re: Menu shortcut keys do not work when Form.Show is called.
::Date: Tue, 15 Jul 2003 12:30:40 -0400
::Lines: 151
::Organization: Diebold Inc.
::X-Priority: 3
::X-MSMail-Priority: Normal
::X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
::X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
::Message-ID: <#[email protected]>
::Newsgroups: microsoft.public.dotnet.framework.windowsforms
::NNTP-Posting-Host: 204.151.249.23
::Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
::Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:48327
::X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
::
::Is there any other workaround besides converting my C# DLL to a C++ DLL?
::Converting to a C++ DLL would be very impractical.
::
::--
::-----------------------------------
::Ken Varn
::Senior Software Engineer
::Diebold Inc.
::[email protected]
::-----------------------------------
::::> Thank you for your detailed information. It seems that there are some
::> problems of interoperation between C# DLL and managed C++ application.
::>
::> Please try to create a window with mainmenu attached by shortkeys with
::> managed C++ in a DLL and then show the window in DLL from a managed C++
::> application to see if the issue remains.
::>
::> Thank you.
::>
::> Regards,
::> Justin Wan
::> Microsoft Partner Online Support
::>
::> This posting is provided "AS IS" with no warranties, and confers no
::rights.
::> --------------------
::> ::Reply-To: "Ken Varn" <[email protected]>
::> ::From: "Ken Varn" <[email protected]>
::> ::References: <[email protected]>
::> <[email protected]>
::> ::Subject: Re: Menu shortcut keys do not work when Form.Show is called.
::> ::Date: Mon, 14 Jul 2003 09:13:04 -0400
::> ::Lines: 84
::> ::Organization: Diebold Inc.
::> ::X-Priority: 3
::> ::X-MSMail-Priority: Normal
::> ::X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
::> ::X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
::> ::Message-ID: <[email protected]>
::> ::Newsgroups: microsoft.public.dotnet.framework.windowsforms
::> ::NNTP-Posting-Host: 204.151.249.23
::> ::Path:
::>
::cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNG
P0
::> 8.phx.gbl!tk2msftngp13.phx.gbl
::> ::Xref: cpmsftngxa06.phx.gbl
::> microsoft.public.dotnet.framework.windowsforms:48254
::> ::X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
::> ::
::> ::I have a managed C++ MFC windows application that is displaying a .NET
::> ::windows form that is contained in a C# DLL. The C++ application
::displays
::> ::the C# form using the Show method. The C# windows form has a main
menu
::> ::where some menu items have shortcut keys. When I press the shortcut
::key,
::> ::the menu item is not selected.
::> ::
::> ::However, I have another C# application that displays the same windows
::form
::> ::that is in the C# dll mentioned above. The only difference is that
the
::C#
::> ::application displays the form using the ShowDialog() method. When
this
::is
::> ::done, the shortcut keys on the menu work fine.
::> ::
::> ::I tried to make a C# application show the dialog using the Show method
::and
::> ::that also seems to work fine. Not sure why the C++ application is
::having
::> ::problems.
::> ::
::> ::--
::> ::-----------------------------------
::> ::Ken Varn
::> ::Senior Software Engineer
::> ::Diebold Inc.
::> ::[email protected]
::> ::-----------------------------------
::> ::::> ::> Hello Ken,
::> ::>
::> ::> I am not quite clear about your description. Which form's menu will
::not
::> ::> work as expected, the main form or the child form which is shown by
::the
::> ::> main form.
::> ::>
::> ::> Would you provide a clear repro steps with which I will fully
::understand
::> ::> what is the problem.
::> ::>
::> ::> Thank you!
::> ::>
::> ::> Regards,
::> ::> Justin Wan
::> ::> Microsoft Partner Online Support
::> ::>
::> ::> This posting is provided "AS IS" with no warranties, and confers no
::> ::rights.
::> ::> --------------------
::> ::> ::Reply-To: "Ken Varn" <[email protected]>
::> ::> ::From: "Ken Varn" <[email protected]>
::> ::> ::Subject: Menu shortcut keys do not work when Form.Show is called.
::> ::> ::Date: Fri, 11 Jul 2003 11:13:06 -0400
::> ::> ::Lines: 16
::> ::> ::Organization: Diebold Inc.
::> ::> ::X-Priority: 3
::> ::> ::X-MSMail-Priority: Normal
::> ::> ::X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
::> ::> ::X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
::> ::> ::Message-ID: <[email protected]>
::> ::> ::Newsgroups: microsoft.public.dotnet.framework.windowsforms
::> ::> ::NNTP-Posting-Host: 204.151.249.23
::> ::> ::Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
::> ::> ::Xref: cpmsftngxa06.phx.gbl
::> ::> microsoft.public.dotnet.framework.windowsforms:48154
::> ::> ::X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
::> ::> ::
::> ::> ::I have a form that I build in C# that does not seem to annunciate
a
::> menu
::> ::> ::item selection when a shortcut key is pressed. It only seems to
::occur
::> ::if
::> ::> I
::> ::> ::display the form using the Form.Show() method. The problem does
not
::> ::seem
::> ::> to
::> ::> ::occur when I use Form.ShowDialog().
::> ::> ::
::> ::> ::Can someone explain how I can get around this problem?
::> ::> ::
::> ::> ::--
::> ::> ::-----------------------------------
::> ::> ::Ken Varn
::> ::> ::Senior Software Engineer
::> ::> ::Diebold Inc.
::> ::> ::[email protected]
::> ::> ::-----------------------------------
::> ::> ::
::> ::> ::
::> ::> ::
::> ::>
::> ::
::> ::
::> ::
::>
::
::
::
 
Back
Top