I have developed a program (c#, .netcf) for some PNA devices shipped with Windows CE 6.0. The text on the mainmenu, contextmenu and messagebox controls were unreadable due to their font size. There is no way to change these control's font and some other major properties. So I decided to write my own classes to get full control over these controls. If you have the same problem feel free to use and/or modify the shared code.
Using the code
The usage of the controls are fairly straightforward. You can see some examples in the sample project.
Custom MessageBox class: Use it as the same way as .NET MessageBox. Custom messagebox has the same constructor with the same parameters as the normal messagebox. So you can use this in your exiting code without any change. The only thing you must to do is place the messagebox class to the same namespace with the code what which will use it. If you want to use it from more different namespaces, you will have to create a messagebox class for each namespaces and from their show() method you can call the custom messagbox class show() method, otherwise the codes exits in the other namespaces will use the system default messagebox class.
MessageBox.Show("This is a custom messagebox","ATTENTION",MessageBoxButtons.AbortRetryIgnore,MessageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1);
The newly created messagebox will looks like this:
Context Menu class:
Simply create a new CustomContextMenu instance. You can attach the menu to any type of controls.
CustomContextMenu contextMenu = new CustomContextMenu(this.dataGrid,new Font("Arial",13,FontStyle.Bold));
contextMenu.AddContextMenu("Context menu 1",menu_Click);
contextMenu.AddContextMenu("Context menu 2",menu_Click);
Main Menu class:
Simply create a new CustomMainMenu instance. Add eventhandlers to the menu which has no submenu. Do not forget to create a main menu before you add a submenu to it. (see below)
CustomMainMenu mainMenu = new CustomMainMenu(this,new Font("Arial",13,FontStyle.Bold));
Points of Interest
C#, MSSQL, Mobile devices