Search Results

Search found 29 results on 2 pages for 'menustrip'.

Page 1/2 | 1 2  | Next Page >

  • [C#] Closing a MenuStrip programatically

    - by Nilbert
    I have a MenuStrip that I have added to a form, and in one of the dropdown menus in it, I have a text box. When I hit enter on the textbox, I want a function to run, then the drop down menu to close. I know how to get the enter part done, but I have no idea how to close the MenuStrip dropdown menu. Does anybody know how to do this?

    Read the article

  • Using a Windows 7 style menustrip in Windows Forms

    - by Nilbert
    I am using windows forms and when I use a MenuStrip item, I get something that looks like this: http://imgkk.com/i/ggn1.png Is it possible to use menu strips like the ones the system uses, like in Windows Explorer, or Firefox, for example: http://imgkk.com/i/cxyg.png with Windows Forms, or C# in general?

    Read the article

  • C# Help For Adding Radio Button For MenuStrip.

    - by Gayan J
    Im a beginner for C# language.So i need a help from who genius from this scheme.i need to add a radio button for menu strip. i already change "clickonclick" property to "true".but i need a option like radio button selection. you can see it from windows calculator menu bar.(click View) how can i get to it via using menustrip peoperty.

    Read the article

  • MenuStrip in C#

    The MenuStrip class is the foundation of menus functionality in Windows Forms. If you have worked with menus in .NET 1.0 and 2.0, you must be familiar with the MainMenu control. In .NET 3.5 and 4.0, the MainMenu control is replaced with the MenuStrip control.

    Read the article

  • "Tool tip" covered by ToolStripItems if they have dropdown items?

    - by Theis
    In Windows Forms - if the dropdown items of a MenuStrip has tooltips and dropdown items themselves the tooltip will have about a 50% chance of showing up below the ToolStripItems. What is the workaround? To repro you can create the MenuStrip in Visual Studio or just add the following code to a form and then try to hover your mouse over the menu items to get a tooltip: //Make a menu strip MenuStrip menu = new MenuStrip(); this.Controls.Add(menu); //Add category "File" ToolStripMenuItem fileItem = new ToolStripMenuItem("File"); menu.Items.Add(fileItem); //Add items for (int i = 0; i < 10; i++) { ToolStripMenuItem item = new ToolStripMenuItem("item"); item.ToolTipText = "item tooltip"; item.DropDownItems.Add("sub item"); fileItem.DropDownItems.Add(item); } I am using .NET 3.5

    Read the article

  • Lack of ImageList in MenuStrip and performance issues

    - by Ivan
    MenuStrip doesn't support using ImageList images. What are performance issues of this? Are there chances of using too much GDI resources and slow-downs? How many items should be considered acceptable, after which one should implement custom control that draws images from ImageList?

    Read the article

  • C# menustrip designer

    - by Iceyoshi
    Hi, I'm not sure when this happened but when I was trying to edit a menustrip in my program (in the VS designer), I noticed that the menu items had be grouped or merged. Like: File Edit Format Insert ... Instead of being able to click each menu item and add sub-items to them in the designer, they all were grouped together so I couldn't edit the menu items separately, it's quite painful. I couldn't find any properties related to this, so how could I ungroup the menu items in the designer?

    Read the article

  • Preferred menus for C# application.

    - by SeaDrive
    Which of the menu tools do you use for C# windows applications? I began with MainMenu, but when I moved to VS2005, only MenuStrip appeared in the Toolbox, so I assumed it was new and better. However, the merge/replace action seems to require a lot more time and effort, and leave one open to maintenance problems. (Perhaps my real question is "what were they thinking when they created MenuStrip?) Do you drag/drop the menus, or do you write the code? Do you use MainMenu, MenuStrip, or some other alternatives?

    Read the article

  • How to fix weird scrolling/alignment behavior when using keyboard in MenuStrip?

    - by bentsai
    I started noticing strange behavior when navigating the main toolbar of my Winforms application, and I don't know how to fix it. When I initially open the dropdown of the File menu, it looks like this: I begin to scroll down each item with the arrow keys, and everything is fine until I reach "Exit". As soon as I hit the down arrow key from "Log Off", or if I hit the up arrow key from "Open", the menu rearranges itself to look like this: I'm puzzled by this behavior. The menu still works, and from this point, if I start scrolling up, I can get the arrangement back to normal: A few observations: The menu still works. This doesn't happen when using the mouse. I have some code that toggles the Visible property of some of the menu items. I was able to modify what the arrangement was by playing around with this, but it was still messed up. Can anyone help me understand what is going on, and how to fix it?

    Read the article

  • C#: How to change the region containing MDI children?

    - by Erlend D.
    When creating a MDI parent, the entire "inside" of the form is made the MDI region. If you add a menustrip to the MDI parent, the MDI region is scaled down a bit to make room for the menustrip. But if you add a panel to the top of the MDI parent, the entire inside is still the MDI region. Which means that you can move MDI children up behind the panel, and hide their title line. If you move MDI children behind a menustrip, scrollbars appear, and you can scroll higher up to access the title line. But the scrollbars doesn't appear when you are using a panel instead of a menustrip. Because the MDI region doesn't know about the panel, I suppose. How can I scale the MDI region to start below a given Y value?

    Read the article

  • Cannot see named Silverlight control in code

    - by Alexandra
    In my first few hours with Silverlight 3, as an avid WPF user, I am greatly disappointed at the many things it doesn't support. This seems like an odd issue to me and it's so generic that I cannot find anything online about it. I have the following XAML: <controls:TabControl x:Name="workspacesTabControl" Grid.Row="1" Background="AntiqueWhite" ItemsSource="{Binding Workspaces, ElementName=_root}"/> However, I cannot see the workspacesTabControl in code-behind. I thought maybe IntelliSense is just being mean and tried to go ahead and compile it anyway, but got an error: Error 1 The name 'workspacesTabControl' does not exist in the current context How do I access controls in code-behind? EDIT: I realized I've pasted the wrong error - I have two controls inside the UserControl called workspacesTabControl and menuStrip. I cannot get to either one of them by their name in the code-behind. Just in case, here is the XAML for the menuStrip: <controls:TreeView Grid.ColumnSpan="2" Height="100" x:Name="menuStrip" ItemContainerStyle="{StaticResource MenuStripStyle}" ItemsSource="{Binding Menu, ElementName=_root}"/> EDIT AGAIN: I'm not sure if this is helpful, but I've taken a look at the InitializeComponent() code and here's what I saw: [System.Diagnostics.DebuggerNonUserCodeAttribute()] public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/SapphireApplication;component/SapphireMain.xaml", System.UriKind.Relative)); } It seems that it simply loads the XAML when it runs (not before or during compilation) so the menuStrip and workspacesTabControl names don't actually get registered anywhere (as they usually are in WPF/win Forms). Could that attribute be a problem? And where do I get rid of this requirement for all the future UserControls I make?

    Read the article

  • C#: standard Windows menu bars in Windows Forms

    - by BoltClock
    I noticed that adding a MenuStrip (from the VS Toolbox) to my form design doesn't yield a menu bar like many native Windows applications. Instead I get a menu bar like VS's own. None of the style settings for MenuStrip appear to mimic the much more common native menu bar. Is there a way to add a menu bar to my Windows Forms application that looks the same as the one you see in Notepad, Task Manager, Windows Explorer and others? (Preferably with the designer, but I wouldn't mind adding it programmatically either.)

    Read the article

  • VS2010 is removing code from designer without warning - causing issues

    - by schmoopy
    I have a WinForm with a pretty complex layout (has lots of controls, panels, etc.) Whenever i open the form the file is automatically checked out from source control and it removes anything in the designer file that refereces my menustrip or statusstrip ie: the following get removed (w/o warning) Me.MyMenuStip.SuspendLayout() Me.MyStatusStrip.SuspendLayout() Me.MyMenuStrip.ResumeLayout(False) Me.MyMenuStrip.PerformLayout() Me.MyStatusStrip.ResumeLayout(False) Me.MyStatusStrip.PerformLayout() The code still builds, but there are no Menu or Status items rendered. Any ideas on what i can do? I do not want to just remove/add the menustrip for instance cause i would loose all of my menu items (and there are a lot) Thanks in advance!

    Read the article

  • MainMenu with Images (WinForms, C#)

    - by j-t-s
    Hi All I have a MainMenu in my app and I would like to have little icons relevant to the Item in each menu. But the MainMenu control does not support this. I would use the MenuStrip control, though that is a pretty ugly option in my opinion. Does anybody have any suggestions? Are there any free/open source alt's out there, or would it be easy/possible to implement that feature into the existing MainMenu control? Thanks

    Read the article

  • MainMenu with Images

    - by j-t-s
    I have a MainMenu in my app and I would like to have little icons relevant to the Item in each menu. But the MainMenu control does not support this. I would use the MenuStrip control, though that is a pretty ugly option in my opinion. Does anybody have any suggestions? Are there any free/open source alt's out there, or would it be easy/possible to implement that feature into the existing MainMenu control?

    Read the article

  • submenu items in WPF Menu

    - by Vishal
    how to make SUBMENU ites visible vertical as a left navigation in CODEGURU.COM In windows we use layoutstyle property to make all main and child items to be viewed vertical and DOCK the menustrip to left. How to acheive this in WPF

    Read the article

  • saved image in the picturebox shows no preview

    - by Nivas
    Hi iam new to C# and have loaded the image in the picture box using menustrip and have displayed some text using picturebox_Paint and label. now i tried to save the image (with image and text) using save event from the menustrip. in the saved location the file shows as no preview avaliable and when i tried to open the file it shows out of memory. can any one say where iam going worng.... my coades private void openToolStripMenuItem_Click(object sender, EventArgs e) { string file = ""; OpenFD.FileName = ""; OpenFD.Title = "open image"; OpenFD.InitialDirectory = "C"; OpenFD.Filter = "JPEG|.jpg|Bmp|.bmp|All Files|..*"; if (OpenFD.ShowDialog() == DialogResult.OK) { file = OpenFD.FileName; pictureBox1.Image = Image.FromFile(file); sz = pictureBox1.Size; a=sz.Width; b= sz.Height; } private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: { rect = new Rectangle(rect.Left, rect.Top, e.X - rect.Left, e.Y - rect.Top); this.Invalidate(); y = flag.e; Application.DoEvents(); break; } } } private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { rect = new Rectangle(e.X, e.Y, 0, 0); this.Invalidate(); } private void pictureBox1_Paint(object sender, PaintEventArgs e) { using (Pen pen = new Pen(Color.Red, 2)) e.Graphics.DrawRectangle(pen, rect); //e.Graphics.DrawString(label1.Text, label1.Font, new // SolidBrush(label1.ForeColor), label1.Left - pictureBox1.Left, label1.Top - pictureBox1.Top); if (label1.TextAlign == ContentAlignment.TopLeft) { e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(label1.ForeColor), label1.Bounds); } else if (label1.TextAlign == ContentAlignment.TopCenter) { SizeF size = e.Graphics.MeasureString(label1.Text, label1.Font); float left = ((float)this.Width + label1.Left) / 2 - size.Width / 2; RectangleF rect1 = new RectangleF(left, (float)label1.Top, size.Width, label1.Height); e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(label1.ForeColor), rect1); } else { SizeF size = e.Graphics.MeasureString(label1.Text, label1.Font); float left = (float)label1.Width - size.Width + label1.Left; RectangleF rect1 = new RectangleF(left, (float)label1.Top, size.Width, label1.Height); e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(label1.ForeColor), rect1); } label1.Top = rect.Top; label1.Left = rect.Left; label1.Width = rect.Width; label1.Height = rect.Height; } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog SaveFD1 = new SaveFileDialog(); //string Sd_file = ""; SaveFD1.FileName = ""; SaveFD1.InitialDirectory = "C"; SaveFD1.Title = "save file Name"; SaveFD1.Filter= "JPG|.jpg|Bmp|.bmp"; if (SaveFD1.ShowDialog() != DialogResult.Cancel) { System.IO.Stream filename = (System.IO.FileStream)SaveFD1.OpenFile(); if (SaveFD1.Filter == "JPG") pictureBox1.Image.Save(SaveFD1.FileName); //pictureBox1.Image.Save (filename, System.Drawing.Imaging.ImageFormat.Jpeg); else if (SaveFD1.Filter == "Bmp") { //pictureBox1.Image.Save(filename, System.Drawing.Imaging.ImageFormat.Bmp); } filename.Close(); } }

    Read the article

  • Customize ToolStripMenuItem

    - by Lu Lu
    Hello everyone, I want to customize ToolStripMenuItem by overriding OnPaint function. This is a MyToolStripMenuItem: public class MyToolStripMenuItem : ToolStripMenuItem { public MyToolStripMenuItem() :base() { } public MyToolStripMenuItem(string t) :base(t) { } protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle r = this.Bounds; g.FillRectangle(Brushes.Blue, r); g.DrawString(this.Text, this.Font, Brushes.Red, r); } } In my code, I will fill a blue color in item's bound. Now, I will create a list of items on menustrip: MyToolStripMenuItem1 |___MyToolStripMenuItem2 |___MyToolStripMenuItem3 I don't know why MyToolStripMenuItem3 don't have a blue background. This is my source code: http://www.mediafire.com/?2qhmjzzfzzn Please help me. Thanks.

    Read the article

  • Should non-English member names be changed to English?

    - by M.A. Hanin
    Situation: Automatically generated memebers, such as MenuStrip items, have their (automatically generated) names based on the text entered when the item was created. My most common situation is creating a menu-strip and adding menu-items by entering their text (using the graphical designer). Since my GUI is in Hebrew, all these members have a name which contains a Hebrew string. Something like "(hebrew-text)ToolStripItem". When I create event handlers, the event handlers "inherit" the hebrew text: "(hebrew-text)ToolStripMenuItem_Click". This actually works well, IntelliSense has no problem with Hebrew text, and so does the compiler. The question is: should I change these names (or prevent them from being created in the first place)? What are the possible consequences of keeping those names?

    Read the article

  • Pass Value between MDI Child in WinForm using C#

    - by abhilashca
    I have an MDI Parent, containing a MenuStrip. When I click on one of the Menu, two Child Forms are displayed simultaneoulsy. I have a TextBox and a Send Button on one of my ChildForm. When I type-in something in that TextBox and Click the Send Button, I need to show that value in the TextBox of my Second Child Form. What I had done is, I wrote a Public Function in the Second Child Form and tried to invoke it by creating an object of Second Form, on the Send Button click event. When I put break points, in that Public Function, I find that the control is flowing through that Public function on cliking the Send button. But the passed value is not displayed. And, I know that is not the standard way to do that. Any sample script for help? Thanks.

    Read the article

1 2  | Next Page >