Custom Windows Form menu in vb.net - vb.net

I want to make a Custom Windows Forms menu. Now, when I say "menu", I mean where the "Exit", "Maximize" and the "Minimize" icons are. I have seen in Microsoft Office software that Microsoft have done a custom WinForms Menu, and in many other software. I have done research for months, and searched so much and have not found anything! I have, found some companies which are currently selling Component Packages with Visual Basic, C# and Visual C++ components, however I do not have the money to buy one of these packages, therefore I need help making a custom Windows Form menu.
I would like to make a Custom Windows Form Menu as a "Ribbon" type. So, It will have a "Ribbon Form Menu". However, I do not wish to use any products or packages to do this for me, seen as I don't have money for them.
I have tried a number of ways for creating a Custom Form Menu:
Used a ToolStrip docked to the top of the form, and set the property of "Left to right" to True, and used buttons or labels for the "Exit", "Maximize" and "Minimize" buttons, although, this isn't really ideal, and I don't really want that anymore.
Used buttons at the top of the Form and docked a panel behind it to made it look like a custom form, but again, this isn't really ideal either.
Anyway, please can someone help me make a custom Windows Forms Menu? It would be nice if you could help me make it in the "Ribbon Style" too!
Please note this post is aimed at the Visual Basic Programming language.. I am using Visual Basic! :D
Thanks.

You have a few options, Firstly you can extend the ClientArea into the NonClientArea
and you would end up with something like: http://www.codeproject.com/Articles/44235/Painting-Vista-s-Aero-NonClientArea-in-VB-NET
After doing some digging i found a .net wrapper for the windows 7 ribbon control, I haven't tried using it yet but you might be able to make it work:
http://windowsribbon.codeplex.com/
Alternatively you can create it all from scratch, setting the FormBorderStyle to None and handling the moving/re-sizing etc by your own code.
As well as painting the Ribbon-like controls yourself.
The latter is a lot more work but is the most customizable, I hope this is helpful and gets you on the right track!

Related

Changing application layout via buttons in VB .NET

Currently I would like to program an application gathering forms that are callable with buttons on the side. For this, I am using the latest build of Visual Studio Community. One way I thought of would be to literally put all the form elements (textboxes, lists, etc.) in the application window and only enable them whenever the according button is clicked on. However, if this is the way to do it, I find it quite messy and unpractical, and I'm pretty sure there's another way around.
After some research, I have learned about the MDI layouts, but they don't suit my taste. I would like to keep everything in one single frame.
Could you give me a hand?

VS 2010 Windows Form App - One Form has a different visual style - why?

I am building my first "real" VB Window Forms Application (I'm a "traditional programmer") and my application has perhaps half a dozen forms.
On execution all of these forms have the Windows 10 visual style (eg: grey on white max/min/close buttons at top right)... except for 1 form, which seems to be rendering in Win XP style (eg: Blue and red button style).
I have checked that "Enable XP Visual Styles" is UNClicked in the Project Properties, but this one form stubbornly refused to change.
I have a number of my forms that also appear in "XP style" in the VS Designer, but execute fine.
I suspect I may have enabled/disabled the "XP Visual Styles" option a couple of times, and perhaps initially created some forms when this was in different states... although I have no idea if this would have been the cause.
I really want this one form to be like all the others...
any ideas please? I am using VB in VS2010 (a bit old, but what I have to hand)
As I am quite new to VB so tell me what I can provide to help..
Many thanks,
David's comment has solved my immediate issue:
The single form appearing differently is indeed using Show() whereas the others are all ShowDialog(). There is no reason for me doing this, so I have changed it.

Tab Order in Visual Studio hates me

Tab Order in Visual Studio does not work for me for some reason.
I am making a VB.NET plugin for a cad program called Rhinocreos 5.
I have everything set perfect, and I don't know what the cause of it is.
I am using .Show() instead of .ShowDialog(), because I need that thread open and I don't feel like doing any thread management (not paid enough lol)
Does anyone have any pointers for this? Has anyone else ran into a tab problem with Rhino5 and .NET?
EDIT**
Seems I have to use a MODELESS Form for a rhino plugin.... So I wont have any tab keys or arrow keys unless I do a hook. But since I need to make the plugin future proof (in case I am no longer working here), I won't be doing that either. But thanks for the answers, comments, and awesome downvotes.
Very difficult to guess what's going on from the information you have provided, but I'd check the following things in the following order:
The disobedient form is open and has focus.
The form has controls in it.
At least some of the controls are enabled, focusable have their TabStop set to true.
There is no low-level keyboard handling in action (PreviewKeyDown, hooks etc).
Finally I'd call ShowDialog() instead of Show(), passing main form as parameter (to make disobedient form a child of main form) and see if that makes a difference.
It was a modeless form inside of Rhino3D as a plugin.
Rhino3D uses all plugins in the main thread. So tab is not an option.
The workaround was to tag all controls with a tag work (I used "tabMe")
Then I store all the controls in a List myTabbyControls.
Each time I press tab, I would cycle through the list.
But thanks for the down votes. It's the running joke of SO.

disable mouse click for a while, of filter mouse clicks

Im using Visual Basic 2008 Express
Is there a way to disable mouse click for a while in Visual Basic 2008, I mean if mouse was clicked more than 1 time in very short time to click only once? -- I need it because my mouse became like crazy one.. when I click once it may clicks twice or more.., This is very very annoying... so until I buy another one, I'd like to filter click, to allow only one click and to block another clicks that were made in last second.
P.S : sorry about that question, but it is really annoying...
Thanks :)
There's an article on processing global mouse events on The Code Project: Processing Global Mouse and Keyboard Hooks in C#. It looks like the article lead to a project called Global Mouse and Keyboard Hooks .NET Libary in C#. You should be able to include the library in your VB.NET project and attach to events from there. The article also references some other information on MSDN that you should read before embarking on this project.
This is something that would be much easier to do from an unmanaged language like C or C++ though.
Although these samples are in C#, they should be easy enough to translate into VB.NET.

Code for extending the NETCF MainMenu to support background color property

I've searched for the solution to change the background color on the Compact Framework's MainMenu control, and the only answer I've found is that you need to create a custom control. Does anyone have example code for this?
I did something vaguely similar where I wanted to handle the WM_EXITMENULOOP message which was not available as an event in .NETCF.
The solution was to "subclass" the Main Menu, an old MFC trick where you replace the WndProc function with your own, handle any windows messages (WM_EXITMENULOOP in my case) and call the base class WndProc for everything else.
Some sample code is available on Alex Yakhnin's blog on how to subclass a control:
Example of subclassing a window in .NETCF
In your case you'd actually be subclassing the Form that the MainMenu resides on, and I think WM_DRAWITEM would be the windows message you'd want to handle yourself.
I haven't tried changing the background color myself so not totally sure this will work, but subclassing would be where I'd start.
There is no way of doing this.
Your right in that you'll probably need to create your own control.
This was something I was considering doing anyway to make the application go on Windows CE and Windows Mobile.
The problem with adding menus when the application needs to work with both is that the menu goes to the top of the screen on Windows CE and covers any controls that might be there.
It would be less hassle in the long run just make a new control.
I tried to do something similar a while back and discovered that you have to write your own menu; essentially from scratch. I gave up because the project I was working on couldn't afford the expense. I also discovered that OpenNETCF has a pretty awesome menu control. I don't know if it's included in their free software, but it might be worth looking into.