Search Results

Search found 43 results on 2 pages for 'toolstrip'.

Page 1/2 | 1 2  | Next Page >

  • ToolStrip memory leak

    - by Marcus
    Hi, I've been having trouble with memory leaks with the SWF-ToolStrip. According to this http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=115600# is has been resolved. But here it seemes not. Anyone know how to resolve this?

    Read the article

  • WinForms Menu Toolstrip Get Status

    - by Yeti
    So I have a project where there is some automatic initialization going on through some classes that are created automatically as global variables (yeah they are static instances). At a point inside this (it has no relation with the C# GUI for the user, so it isn't derived from any C# class) I need to see if a flag is set or not. I use toolstrip menu with checked and unchecked status in order to set or unset the flag. The problem is that I have difficulties to see if the flag is checked or not from this static class. My class is inside a different project/namespace and a DLL is created what later is linked to the GUI of the application. The GUI depends from this Manager class so making the Manager class to depend from the GUI is not an option. Nevertheless, I should be able to see its state knowing its name or through some other means. I have tried the following: if(Application.OpenForms[1].Owner.Controls["useLocalImageForInitToolStripMenuItem"].Enabled) { }; Now the problem is that on the upper code snippet I get a nasty error. So how do I do this? The toolstrip menu: The error: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ***** Exception Text ******* System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at System.Windows.Forms.FormCollection.get_Item(Int32 index) at Manager.MyMainManager.MyMainManager.RealTimeInit() in C:\Dropbox\My Dropbox\Public\Program Code\RoboCup\Manager\MyMainManager\MyMainManager.cs:line 494 at mainApp.MainForm.ButtonInitClick(Object sender, EventArgs e) in C:\Dropbox\My Dropbox\Public\Program Code\RoboCup\mainApp\MainForm.cs:line 389 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Read the article

  • C# Menu Toolstrip Get Status

    - by Yeti
    So I have a project where there is some automatic initialization going on through some classes that are created automatically as global variables (deah they are static instances). At a point inside this (it has no relation with the C# GUI for the user, so it isn't derived from any C# class) I need to see if a flag is set or not. I use toolstrip menu with checked and unchecked status in order to set or unset the flag. The problem is that I have difficulties to see if the flag is checked or not from this static class. My class is inside a different project/namespace and a DLL is created what later is linked to the GUI of the application. The GUI depends from this Manager class so making the Manager class to depend from the GUI is not an option. Nevertheless, I should be able to see its state knowing its name or through some other means. I have tried the following: if(Application.OpenForms[1].Owner.Controls["useLocalImageForInitToolStripMenuItem"].Enabled) { }; Now the problem is that on the upper code snippet I get a nasty error. So how do I do this?

    Read the article

  • How to make Custom contol look like other ToolStrip Items?

    - by nils_gate
    I have created a Custom Hosted Control using ToolStripControlHost and put it in a ToolStrip. Everything is working as expected. But my custom control does not look like other items in ToolStrip. How to make my custom control take the look and feel from ToolStripRenderer? or How to make it look like other items in ToolStrip?

    Read the article

  • ToolStrip control never fire Enter/Leave event??

    - by AZ
    I created a movable panel in WinForms. I use a ToolStrip as a titlebar in the panel. I'll use the ToolStrip to move the panel as well as indicating the panel is "active" or not. So when the panel is active, I want to change the ToolStrip's BackColor to Red. The idea is capturing ToolStrip's Enter/Leave event to change the color, but it seems those events are never fired. Are those events truly never fired? Should I capture other events?

    Read the article

  • How to make a ToolStripComboBox to fill all the space available on a ToolStrip?

    - by Ivan
    A ToolStripComboBox is placed after a ToolStripButton and is folowed by another one, which is right-aligned. How do I best set up the ToolStripComboBox to always adjust its length to fill all the space available between the preceeding and the folowing ToolStripButtons? In past I used to handle a parent resize event, calculate the new length to set based on neighboring elements coordinates and setting the new size. But now, as I am developing a new application, I wonder if there is no better way.

    Read the article

  • A generic error in GDI+ with ToolStrip in ManagerRenderMode

    - by volody
    I have a vb.net form with ToolStrip menu RenderMode - ManagerRenderMode LayoutStyle - HorizontalStackWithOverflow My development environment is .net 4.0, VS2010, windows 7 x64; but occasionally I am getting next error A generic error occurred in GDI+. Stacktrace: at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height) at System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect) at System.Windows.Forms.ToolStripProfessionalRenderer.FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, Int32 firstGradientWidth, Int32 secondGradientWidth, LinearGradientMode mode, Boolean flipHorizontal) at System.Windows.Forms.ToolStripProfessionalRenderer.RenderToolStripBackgroundInternal(ToolStripRenderEventArgs e) at System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripBackground(ToolStripRenderEventArgs e) at System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground(ToolStripRenderEventArgs e) at System.Windows.Forms.ToolStrip.OnPaintBackground(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Read the article

  • Handle tab key in ToolStripComboBox

    - by Jiri
    Hi, I have a ToolStripComboBox in a ToolStrip, and when I press TAB key in it, it gives focus to the next toolstrip button. I would like to change this behavior and give focus to a richtextbox on my form instead. The problem is that ToolStripComboBox does not have PreviewKeyDown event. And PreviewKeyDown of the hosting ToolStrip Toolbar is not called when tab key is pressed in the combo (just when pressed and some toolstripbutton is focused). TabStop of the toolstrip toolbar is false. Any ideas?

    Read the article

  • Show ContextMenuStrip from ToolStripDropDown without dismissing ToolStripDropDown

    - by Jacob G
    I have a ToolStrip. In my ToolStrip I have a ToolStripDropDownButton. My ToolStripDropDownButton has a DropDown of type ToolStripDropDown that contains a ToolStripControlHost which contains a Label. I have assigned a ContextMenuStrip to my Label. When I show the DropDown and right-click on the label, the ContextMenuStrip displays correctly, but the original DropDown is dismissed. I can understand the existence of underlying code to prevent the display of two "ToolStripItems" at the same time and I'm assuming that's what I'm running in to here. Anybody know of a way around it?

    Read the article

  • Image display incorrect on toolstrip

    - by Lu Lu
    I use a 32-bit image & use it as a value for Image property of ToolStripButton. But I don't know why it displays unlike the original one. This is the screenshot: And my project: http://www.mediafire.com/?3mzmf5r5nnx Please help me to find the reason. Thanks.

    Read the article

  • Why do my horizontal toolstrips keep stacking verticaly?

    - by Eric
    I'm using a ToolStripContainer that contains three ToolStrips. At design time I move the ToolStrips to the positions I want them in, which is in a horizontal row across the top of the form like this: I then close and save the Form. However, if I open the form up again the ToolStrips end up stacked up on the left side of the ToolStripContainer like this: How can I keep the ToolStrips in the positions that I specify?

    Read the article

  • Memory leak, again!

    - by Dave
    A couple of weeks ago I was having trouble with memory leaks associated with a ContextMenuStrip. That problem was fixed. See that question here Now I'm having similar issues with ToolStrip controls. As in the previous problem, I'm creating a large number of UserControls and adding them to a FlowLayoutPanel. Each control creates a ToolStrip for itself in its constructor. When a control is removed from the FlowLayoutPanel (the only reference to the control), it seems memory for the ToolStrip is not being released. However when I comment out the code that creates the ToolStrip the memory leak doesn't happen. Is this the same sort of issue as the previous one - I need to set the ToolStrip to null? I don't see how that could be since this time the control is creating the strip itself, and all the button events etc are handled inside it. So shouldn't everything be GC'd when the control is no longer referenced? EDIT: As to the comments, the thing I don't understand is originally I was "making" my own toolstrip out of a panel and some labels. The labels were used as buttons. No memory leaks occurred this way. The only thing I've changed is using a proper ToolStrip with proper buttons in place of the panel, but all the event handlers are wired the same way. So why is it now leaking memory?

    Read the article

  • Why is a NullReferenceException thrown when a ToolStrip button is clicked twice with code in the `Click` event handler?

    - by Patrick
    I created a clean WindowsFormsApplication solution, added a ToolStrip to the main form, and placed one button on it. I've added also an OpenFileDialog, so that the Click event of the ToolStripButton looks like the following: private void toolStripButton1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); } I didn't change any other properties or events. The funny thing is that when I double-click the ToolStripButton (the second click must be quite fast, before the dialog opens), then cancel both dialogs (or choose a file, it doesn't really matter) and then click in the client area of main form, a NullReferenceException crashes the application (error details attached at the end of the post). Please note that the Click event is implemented while DoubleClick is not. What's even more strange that when the OpenFileDialog is replaced by any user-implemented form, the ToolStripButton blocks from being clicked twice. I'm using VS2008 with .NET3.5. I didn't change many options in VS (only fontsize, workspace folder and line numbering). Does anyone know how to solve this? It is 100% replicable on my machine, is it on others too? One solution that I can think of is disabling the button before calling OpenFileDialog.ShowDialog() and then enabling the button back (but it's not nice). Any other ideas? And now the promised error details: System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="System.Windows.Forms" StackTrace: at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at WindowsFormsApplication1.Program.Main() w C:\Users\Marchewek\Desktop\Workspaces\VisualStudio\WindowsFormsApplication1\Program.cs:line 20 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

    Read the article

  • C# PrintPreviewDialog Modification possible?

    - by C. Griffin
    Currently, what I'm doing is this: Using the built-in .NET PrintPreviewDialog Attaching my own Click handler to the Print button, which allows for the user to select the printer before finally printing. This all WORKS, HOWEVER, the OnprintToolStripButtonClick event is still sending the document to the default printer BEFORE the user gets to choose the actual printer and click Print (which works, but they're getting an extra copy on the default printer first from the old Handler). Can I remove this built-in Click handler? I've tried the other methods mentioned on here in regards to using an EventHandlerList to remove the handlers, but it doesn't work for the built-in printing event. Here is a copy of my current code in case it helps clarify: // ... Irrelevant code before this private PrintPreviewDialog ppdlg; ToolStrip ts = new ToolStrip(); ts.Name = "wrongToolStrip"; foreach (Control ctl in ppdlg.Controls) { if (ctl.Name.Equals("toolStrip1")) { ts = ctl as ToolStrip; break; } } ToolStripButton printButton = new ToolStripButton(); foreach (ToolStripItem tsi in ts.Items) { if (tsi.Name.Equals("printToolStripButton")) { printButton = tsi as ToolStripButton; } } printButton.Click += new EventHandler(this.SelectPrinterAfterPreview); // ... Irrelevant code afterwards omitted // Here is the Handler for choosing a Printer that gets called after the // PrintPreviewDialog's "Print" button is clicked. private void SelectPrinterAfterPreview(object sender, EventArgs e) { frmMainPage frmMain = (frmMainPage)this.MdiParent; if (frmMain.printDialog1.ShowDialog() == DialogResult.OK) { pd.PrinterSettings.PrinterName = frmMain.printDialog1.PrinterSettings.PrinterName; pd.PrinterSettings.Copies = frmMain.printDialog1.PrinterSettings.Copies; pd.Print(); } }

    Read the article

  • How can I loop thru all controls (including ToolStripItems) C#

    - by Murray
    I need to save and restore settings for specific controls on a form. I loop thru all controls and return the one whose name matches the one I want, like so: private static Control GetControlByName(string name, Control.ControlCollection Controls) { Control thisControl = null; foreach (Control c in Controls) { if (c.Name == name) { thisControl = c; break; } if (c.Controls.Count > 0) { thisControl = GetControlByName(name, c.Controls); if (thisControl != null) { break; } } } return thisControl; } From this I can determine the type of control and therefore the property that should be / has been stored. This works well unless the control is one of the ToolStrip family which has been added to a toolstrip. e.g. this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lblUsername, // ToolStripLabel this.toolStripSeparator1, this.cbxCompany}); // ToolStripComboBox In this case I can see the control I'm interested in (cbxCompany) when debugging, but the name property has no value so the code does not match to it. Any suggestions on how I can get to these controls too? Cheers, Murray

    Read the article

  • paint.NET crasing when using the menus

    - by bobber205
    Whenever I go to the menus in paint.NET it crashes with an error log saying the below. I tried the newest version as well as verison 2.7 Any ideas on what's going on? :P Exception details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.MenuStrip.WndProc(Message& m) at PaintDotNet.SystemLayer.MenuStripEx.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Read the article

1 2  | Next Page >