winforms

Winform app not closing

I have a small app that a client uses to manually update some data. It is very basic; on load it populates a list of companies the user can select from and click a button to update the data in another system. The client wants to be able to run this same functionality from command line so I have added a background worker. When the app is ...

WinForms - is there an event captured for changed children controls by a containing panel?

Hi, I have a panel and in it are a couple of text boxes, I want to decide if to enable a button (also inside the panel) by the values of the the text boxes. Is there a predefined event the panel is registered to that captures the inner text-boxes onTextChange event? Thanks, Shuky ...

Windows Forms Designer Float overflow

I'm not sure what's changed, but for some reason I'm getting a problem with Visual Studio 2008 Windows Forms Designer: C++ CodeDOM parser error: Line: 1978, Column: 80 --- Float overflow The call stack doesn't seem to point to any of my code either: at Microsoft.VisualC.CppCodeParser.OnMethodPopulateStatements(Object sender, Even...

Give me a hint on FormClosing event ...

Hello guys, I have a MainForm. I can close it by using a close button (upper right corner) or by clicking a menuitem miExit. My problem is when I clicked miExit and answered "OK", it shows messageBox TWICE. How can I fix it ? (I understand why it shows twice but how can I avoid it ?) Both formclosing and miExit clicks must provide mess...

C# - TabPage Color event

Hello, C# certainly isn't my strong suit so I appreciate all the generous folk sharing their knowledge. I'm working with a Windows Form and I've read up on events and have found some excellent help on how to modify a TabControl so I can have an OnDraw event that will add some coloring to the tabs. The color of each tab is based upon th...

WinForm WebBrowser Control slow to load. Best Method for pre-loading?

We have a summary view in our winform app that uses a WebBrowser control to display the summary information from a web page. We are using this to gain some rich tabular layout that we could not accomplish using standard winform controls. the first time the view is displayed on the client it takes a while to spin up (launching IE in the...

Reuse a ToolStripMenu for a ToolStrip or a ContextMenuStrip?

Hey folks, In my application, I have a ToolStripMenu (File, Edit, Notes), a ToolStrip right above my work area and a context menu for the work area itself. Now the Notes ToolStripMenu, the ToolStrip and the ContextMenuStrip all have the same content that performs the same actions. I was wondering, is there an elegant way to just design ...

reducing the size of the selection box around a winforms custom control

I have a custom control based on the label control. My question is how do I change the selection box size around this custom control when a user selects it while in design mode. The need is the box is too large I need to make it smaller. Also AutoSize set to true will not work in my case, the selection box is still too big. ...

How can I create a line in a WinForms Application?

Hi. I want to create a simple 3D line in a WinForms application to improve visual arrangement of my form layout. This line is exacly like the line in About Windows dialog (can be opened in Windows Explorer -> Help -> About Windows). An example be checked here. The last line (3D) is the one I want, not the first one. How can this be do...

How can I make a single instance form (not application)?

In my C# application I have an option dialog that can be opened from a menu command. I want to ensure that the option dialog have only one instance (user cannot open more than one option window at a given time) without making it modal. Also if the user already have this window opened, and he clicks in the menu item to open it again, th...

.NET Winforms textbox - how to account for non-standard linebreaks?

I have an app that has a multiline text box on it. This is data that comes from a client application elsewhere. There are different versions of the client app for different platforms, and furthermore these platforms have different default rules about line endings. Thus, the data I want to show in the textbox might have CR+LF line endi...

Problem with VS 2010 IDE when removing event handler using properties window

Here's the steps to reproduce the problem : Create a c# project with a form with 1 control, let's say a textbox. Using the properties window (lightning bolt thingy), add a "click" event. Write some code in that method. Using the properties window, remove the content of the "click" event cell. I would like to know why is the code from...

C# win form custom control - disable selection box, and use font color for selection indicator.

I have a custom control based on the label control. My question is how I disable the selection box around this custom control when a user selects it while in design mode. I would like to just change the font color when selected, and then change it back when unselected. The reason for this is because when you have many labels with small...

WPF: use Snoop on Windows launched from WinForms?

is it possible to get snoop to profile WPF Windows launched from WinForms app? ...

WinForms tooltip flips over when tab key is pressed

I have a balloon tooltip control on a form. If the user enters incorrect information then the tooltip is displayed. The problem is if you display the tool tip and then hit the tab button the tooltip 'flips' over, is there any way to stop this behavior? ...

How do I set a textbox's text to bold at run time?

I'm using Windows forms and I have a textbox which I would occassionally like to make the text bold if it is a certain value. How do I change the font characteristics at run time? I see that there is a property called textbox1.Font.Bold but this is a Get only property. ...

What is the main difference between ReadOnly and Enabled?

In win forms controls, there are two properties : ReadOnly and Enabled. Can someone give me any information about what the difference between these two properties are. I feel like they behave the same way. ...

A way to overcome RichTextBox's limitations?

Hey folks, I am developing an app using WinForms and the RichTextBox control. This control allows different changes to the RTF formatting using a property to change the font of the selected text. I have a button to toggle bold on the text: richTextBoxEditor.SelectionFont = new Font(richTextBoxEditor.SelectionFont, richTextBoxEditor...

A Toolstrip that can auto size itself

I am using this nice code which by the way if you are aware of any better way to accomplish this, I really appreciate letting us know . so here is the Toolbar that can float : http://en.csharp-online.net/Tool,_Menu,_and_Status_Strips%E2%80%94Floating_ToolStrips good, but what if I only have 4 buttons on this toolbar, when I make it flo...

Extending legacy C++ Windows app with WinForms

Hi I'm working on an legacy C++ application that runs on rugged business mobile devices made by Intermec. I need to add some functionality and would like to build it using WinForms. The idea is that users would click a button in the old app which would launch a WinForms screen. Then they do some stuff, click OK and are returned to the C...