Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I want to use the menu control of windows application in my web application. How can I achieve this?
Posted

thats possible !
just add this refrence to your project !

C#
System.Windows.Forms



well you can use anything that is relevant with windows app !

you can is inheritance or use the classes directly !


i hope helped you !
 
Share this answer
 
Comments
Member 8491154 19-Jul-12 0:17am    
Can you provide an example regarding this?
ali_heidari_ 20-Jul-12 19:34pm    
i think this link can solve your problem !

THIS LINK

good luck !
i_share7 11-May-17 12:45pm    
Yeah, you can import the System.Windows.Forms reference to your project and declare a variable as a control, but when you try to add that control to your class it doesn't let you because you are only allowed to add a System.Web.UIControls control.
I could be wrong, but I don't think that's possible.
 
Share this answer
 
Comments
Member 8491154 19-Jul-12 0:18am    
this answer doesn't solve my problem.
Johnny J. 19-Jul-12 2:54am    
I know it doesn't solve your problem, but it is an answer to your question. Even though it might be possible to tweak your project to use a winforms control in your web project, that is not something you should do. Winforms and ASP controls might look and feel the same to the programmer, but they are not the same. They render in a completely different way, they interact in a completely different way. It is not a recommendable solution.

You should use the ASP menu control, something like:

<asp:Menu ID="mnuAdmin" runat="server" DynamicVerticalOffset="2" DynamicHorizontalOffset="10" Orientation="Horizontal" StaticEnableDefaultPopOutImage="false"
Font-Names="Verdana" StaticSubMenuIndent="0px" CssClass="MAXMenu" StaticMenuStyle-Height="5px"
onmenuitemclick="mnuAdmin_MenuItemClick" >
<staticmenuitemstyle cssclass="MAXPlanningMenu">
<staticmenustyle cssclass="MAXPlanningMenu">
<dynamicmenustyle cssclass="MAXSubMenu">
<dynamicmenuitemstyle cssclass="MAXSubMenu">

<staticmenuitemstyle verticalpadding="5px" horizontalpadding="5px">
<dynamicmenuitemstyle horizontalpadding="2px" verticalpadding="5px">
<items>
<asp:MenuItem Text="Administrate users" Selectable="false">
<asp:MenuItem Text="Administrate users" Value="AdministrateUsers">





(Cut directly from a project of mine, so the CSS classes are not general, they are my implementation)

OR you should use one of the MANY Javascript/JQuery menu controls that are available.

Don't downvote an answer just because it's not what you want to hear.
Johnny J. 19-Jul-12 2:56am    
The code above doesn't render ok - I'm sorry, I don't know why. But you should get the general idea...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900