|
Tried it, but the correction doesn't work... Any idea ?
If I Right-Click on a control to display a Pop-Up menu, then I can Right-Click anywhere on the form and the same Pop-Up menu is always displayed, until I Left-Click on something, then the Right-Click works again.
|
|
|
|
|
Phil,
Good stuff. Why don't you grop me a line (namortaror@hotmail.com). There is a project you might be interested in.
Roman
|
|
|
|
|
Failed to download the source codes!!
|
|
|
|
|
According to the code followed
I do not know How can i add my own icon to the menu
can you help me!!!!
How can i to modify the code??
Protected Sub LoadResources()
' Create a strip of images by loading an embedded bitmap resource
_images = ResourceHelper.LoadBitmapStrip(Me.GetType(), _
"SampleMenus.MenuImages.bmp", _
New Size(16, 16), _
New Point(0, 0))
End Sub
Dim window1 As MenuCommand = New MenuCommand("&New Window", _images, 0, New EventHandler(AddressOf OnNewWindowSelected))
Dim window2 As MenuCommand = New MenuCommand("Cl&ose", _images, 1, New EventHandler(AddressOf OnCloseWindowSelected))
|
|
|
|
|
This is what I did in C#, so just do that same thing in vb and you'll get the menu bitmap to show up.
// Create my menu item.
MenuCommand mImport = new MenuCommand("&Import data", m_ImageListToolBar, 16, new EventHandler(OnImportData) );
mMenuCom3.MenuCommands.AddRange(new MenuCommand[]{mImport});
All you have to do is add all your images to a imagelist and then specify the proper imagelist index like I did above.
Hope this helps
|
|
|
|
|
when I did that as you said,
It caused some error as following:
'DefaultDomain': Loaded 'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'UltEditPro': Loaded 'F:\Computer\EXE\Visual C#\myproject\UltEditPro\bin\Debug\UltEditPro.exe', Symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\magiclibrary\1.7.4.0__3a6eb82f876a49bc\magiclibrary.dll', No symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll
Additional information: 'null' is not a valid value for 'stream'.
Unhandled Exception: System.ArgumentException: 'null' is not a valid value for 'stream'.
at System.Drawing.Bitmap..ctor(Stream stream)
at Crownwood.Magic.Common.ResourceHelper.LoadBitmapStrip(Type assemblyType, String imageName, Size imageSize, Boolean makeTransparent, Point transparentPixel)
at Crownwood.Magic.Common.ResourceHelper.LoadBitmapStrip(Type assemblyType, String imageName, Size imageSize, Point transparentPixel)
at UltEditPro.UltEditPro.LoadResources() in f:\computer\exe\visual c#\myproject\ulteditpro\ulteditpro.cs:line 72
at UltEditPro.UltEditPro..ctor() in f:\computer\exe\visual c#\myproject\ulteditpro\ulteditpro.cs:line 45
at UltEditPro.UltEditPro.Main() in f:\computer\exe\visual c#\myproject\ulteditpro\ulteditpro.cs:line 455The program '[2384] UltEditPro.exe' has exited with code 0 (0x0).
|
|
|
|
|
when I did that as you said,
It caused some error as following, why? Would you like to explain it to me?
'DefaultDomain': Loaded 'c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'UltEditPro': Loaded 'F:\Computer\EXE\Visual C#\myproject\UltEditPro\bin\Debug\UltEditPro.exe', Symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll', No symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\magiclibrary\1.7.4.0__3a6eb82f876a49bc\magiclibrary.dll', No symbols loaded.
'UltEditPro.exe': Loaded 'c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll
Additional information: 'null' is not a valid value for 'stream'.
Unhandled Exception: System.ArgumentException: 'null' is not a valid value for 'stream'.
at System.Drawing.Bitmap..ctor(Stream stream)
at Crownwood.Magic.Common.ResourceHelper.LoadBitmapStrip(Type assemblyType, String imageName, Size imageSize, Boolean makeTransparent, Point transparentPixel)
at Crownwood.Magic.Common.ResourceHelper.LoadBitmapStrip(Type assemblyType, String imageName, Size imageSize, Point transparentPixel)
at UltEditPro.UltEditPro.LoadResources() in f:\computer\exe\visual c#\myproject\ulteditpro\ulteditpro.cs:line 72
at UltEditPro.UltEditPro..ctor() in f:\computer\exe\visual c#\myproject\ulteditpro\ulteditpro.cs:line 45
at UltEditPro.UltEditPro.Main() in f:\computer\exe\visual c#\myproject\ulteditpro\ulteditpro.cs:line 455The program '[2384] UltEditPro.exe' has exited with code 0 (0x0).
|
|
|
|
|
I know this is very old, but I thought I would post a response in case anyone else has had this problem, because I just did.
You have to make sure that the bitmap you are using is an embedded resource. If you look in the properties of your bitmap (click on the file in your Solution View, NOT the editor), you will see an option that says "Build Action". You need to change that to "Embedded Resource".
Hope this helps someone
-- Rick
|
|
|
|
|
Thanks a lot!!! It helped me to fix up the problem i was seeing.
regards,
-raghav
|
|
|
|
|
The properties of my bitmap have chosen the "embedded resource",but also have this error,why?
|
|
|
|
|
Hmm, I don't really know without seeing what you are doing. You are welcome to send me a little piece of code that shows the problem you are seeing and I will look at it.
-- Rick
|
|
|
|
|
Great free codes!
I'll try
thanks very much!!!
hi
my name is hustcaozy
|
|
|
|
|
Is it possible to merge or replace the MDI container's menu with that of the child window when the child is maximized?
Now, the child seems to have its menu within its client area.
|
|
|
|
|
Centering is not proper. Top-menu bar does not match VS.NET/OfficeXP. Colors not always correct. Also some strange menu item shading. Shadows not 'native'. Can't someone do it right?
nous sommes les maitres
nous sommes les esclaves
nous sommes partout
nous sommes nul part
nous maitrisons les lettres noires
|
|
|
|
|
From your posts critisizing at least two menu controls on here in the same offensive way ("Bad Code"), I'll tell you this: Create your own control, "get it right," and stop bitching about free code projects.
|
|
|
|
|
When I want to set a MenuCommand to MDIList just like normal menuItem that can show sub forms in a MDI form, but I can not find any way to do that.
|
|
|
|
|
I know this is a late response, but it took me some time to figure this out. I figured I would share the knowledge.
Bottom line, you're responsible for handling this.
Actually, there is a sample in the magic library, entitled "MenuSamples". View the source code. In the SampleMenu.cs file, there is an MDIChild class which I missed when studying the methods initially.
Look at the CreateWindowsMenu method and make note of how two events are binded at the end of the method ( the OnWindowMenuStart and OnWindowMenuEnd ). These two methods emulate the MDIList behavior.
|
|
|
|
|
Version 1.7.3 of the Magic Library is now available from...
http://www.dotnetmagic.com
Includes numerous bug fixes to the Menus, TabControl and Docking functions.
For those new to the library it includes VS.NET style controls for...
Menus,
TabControl,
Tabbed MDI,
Docking Windows,
Wizard Control/Dialog.
All the source code is included in the download that can be used free of charge or royalties in commerical as well as private applications.
Phil Wright
phil.wright@dotnetmagic.com
|
|
|
|
|
Hi,
I've added the magiclibrary 1.7.1 to a C# single window app and then added the MenuControl to the form. While adding submenu collections I get the error 'Object reference not set to an instance of an object'. Is there a way around this?
Thanks mate.
|
|
|
|
|
Same problem here but with version 1.7.4 that I just downloaded.
|
|
|
|
|
When i am using this menuitems with icons in contextMenu at NotifyIcon it just displays an empty bar
can someone help me !
|
|
|
|
|
Try to use this beatiful control as a notify icon context menu this way:
public class MainForm : System.Windows.Forms.Form
{
private Crownwood.Magic.Menus.PopupMenu _NotifyPopupMenu;
private NotifyIcon m_notifyicon;
ImageList _internalImages; //don't forget to load your images before using
...
... //and so on
}
public MainForm()
{
m_notifyicon = new NotifyIcon();
m_notifyicon.Visible = true;
m_notifyicon.Icon = new Icon(GetType(),"my_icon.ico");
m_notifyicon.MouseUp += new MouseEventHandler(OnNotifyIconMouseUp);
InitializeComponent();
}
protected void OnNotifyIconMouseUp(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
m_notifyicon = sender as NotifyIcon;
Crownwood.Magic.Menus.MenuCommand s0 = new Crownwood.Magic.Menus.MenuCommand("First", _internalImages, 0, new System.EventHandler(First_Click));
Crownwood.Magic.Menus.MenuCommand s1 = new Crownwood.Magic.Menus.MenuCommand("Second", _internalImages, 1, new System.EventHandler(Second_Click));
Crownwood.Magic.Menus.MenuCommand s2 = new Crownwood.Magic.Menus.MenuCommand("Third", _internalImages, 2, new System.EventHandler(Third_Click));
_NotifyPopupMenu = new Crownwood.Magic.Menus.PopupMenu();
_NotifyPopupMenu.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[]{s0, s1, s2});
_NotifyPopupMenu.Style = VisualStyle.IDE;
_NotifyPopupMenu.MenuCommands.ExtraText = "Test";
_NotifyPopupMenu.MenuCommands.ExtraTextColor = Color.White;
_NotifyPopupMenu.MenuCommands.ExtraBackColor = Color.DarkBlue;
_NotifyPopupMenu.MenuCommands.ExtraFont = new Font("Arial", 10f, FontStyle.Bold | FontStyle.Italic);
_NotifyPopupMenu.TrackPopup( new Point(Cursor.Position.X, Cursor.Position.Y) );
}
}
protected void First_Click(Object sender, System.EventArgs e)
{
...
}
...
//and so on
Hope this helps.
Regards
|
|
|
|
|
Hi There:
This may or may not be related to the previous background color issue, but here goes: I have experienced the following problem:
1. On my laptop your IDE menu looks awesome as it should
2. On my desktop with a regular monitor, the IDE menu looks almost totally transparent, and I can barely see the menu outline and items. However, the regular menu setting looks fine.
I've looked through your project and unfortunately do not know where to begin to track down this problem, as I am not totally up to speed on C#. Both machines have Windows 2000 Professional, and both machines display the VS.NET menu systems perfectly, so I know there is nothing wrong with my monitor settings. I have downloaded version 1.7.1 of your project.
It would be great if you could provide some code snippets and show me where I could fix this problem. Or better yet, if you have another release available soon with this fix, that would be even better. Have you heard of this issue before or is there a work-around for it?
Regards,
Travis
|
|
|
|
|
I'm actually having the same exact problem. It works fine when I set my computer to High color 16 bit, but the menu's bomb (are transperant etc...) when I set my settings to True color 32 bit.
If anyone knows how this can be fixed, or even what's the reason for this happening - that would be great! thanks.
|
|
|
|
|
|