winforms

Making a C#/Winform application cross-platform - should I use AIR, Mono, or something else?

I have an app that I've written in C#/WinForms (my little app). To make it cross-platform, I'm thinking of redoing it in Adobe AIR. Are there any arguments in favor of WinForms as a cross-platform app? Is there a cross-platform future for Winforms (e.g., Mono, etc.)? Suggestions for cross-platform UI development? By cross-platform I mea...

.NET Windows Forms Transparent Control

I want to simulate a 'Web 2.0' Lightbox style UI technique in a Windows Forms application. That is, to draw attention to some foreground control by 'dimming' all other content in the client area of a window. The obvious solution is to create a control that is simply a partially transparent rectangle that can be docked to the client are...

How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit?

For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be using a different control? Or do...

FileSystemWatcher Dispose call hangs

We just started running in to an odd problem with a FileSystemWatcher where the call to Dispose() appears to be hanging. This is code that has been working without any problems for a while but we just upgraded to .NET3.5 SP1 so I'm trying to find out if anyone else has seen this behavior. Here is the code that creates the FileSystemWatch...

How can I highlight the current cell in a DataGridView when SelectionMode=FullRowSelect

I have an editable DataGridView with SelectionMode set to FullRowSelect (so the whole row is highlighted when the user clicks on any cell). However I would like the cell that currently has focus to be highlighted with a different back color (so the user can clearly see what cell they are about to edit). How can I do this (I do not want t...

How do you change the color of the border on a group box?

In C#.NET I am trying to programmatically change the color of the border in a group box. ...

How to double buffer .NET controls on a form?

How can i set the protected DoubleBuffered property of the controls on a form that are suffering from flicker? ...

Blocking dialogs in .NET WebBrowser control

I have a .NET 2.0 WebBrowser control used to navigate some pages with no user interaction (don't ask...long story). Because of the user-less nature of this application, I have set the WebBrowser control's ScriptErrorsSuppressed property to true, which the documentation included with VS 2005 states will [...]"hide all its dialog boxes th...

Open .NET form in designer mode - get "The path is not of a legal form"

I attempted to open a C#/VB form in designer mode, and instead of the form, I got an ugly error message saying "The path is not of a legal form". This form used to work! What happened? Thanks to all who have answered. This question is a problem I hit a while back, and I struggled with it for a long time, until I found the answer, w...

what is the best control suite for winforms applications?

i know devexpress have some more intuitive controls over infragistics, but what about component factory or telerik? What winforms controls would you recommend? ...

DataGridView : How to can I do multiline data entry in a usable way?

With the DataGridView it is possible to display cells containing some long text. The grid just increases the row height to display all the text, taking care of word wrap and linefeeds. Data entry is possible as well. Control+Return inserts a line feed. But: if the cell only has one line of text initially, the row height is just the heig...

SoundPlayer crash on Vista

The following code is causing an intermittent crash on a Vista machine. using (SoundPlayer myPlayer = new SoundPlayer(Properties.Resources.BEEPPURE)) myPlayer.Play(); I highly suspect it is this code because the prgram crashes mid-beep or just before the beep is played every time. I have top-level traps for all ThreadExceptions,...

Listview Multiple Selection

Is there any way to force a listview control to treat all clicks as though they were done through the Control key? I need to replicate the functionality of using the control key (selecting an item sets and unsets its selection status) in order to allow the user to easily select multiple items at the same time. Thank you in advance. ...

Fade splash screen in and out

In a C# windows forms application. I have a splash screen with some multi-threaded processes happening in the background. What I would like to do is when I display the splash screen initially, I would like to have it appear to "fade in". And then, once all the processes finish, I would like it to appear as though the splash screen is "fa...

Dockable Form

How do you create a "dockable" form, similar to the windows in Visual Studio? ...

How can I make a ComboBox non-editable in .net?

I want to have a "select-only" ComboBox that provides a list of items for the user to select from. Typing should be disabled in the text portion of the ComboBox control. My initial Googling of this turned up an overly complex, misguided suggestion to capture the KeyPress event. ...

How do I disable a button cell in a WinForms DataGrid?

I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes. I can disable the DataGridView control, but it gives no visual indication that the buttons a...

Help getting .Net WinForms apps to support Vista Aero Glass.

There are a couple of tricks for getting glass support for .Net forms. I think the original source for this method is here: http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx Basically: //reference Desktop Windows Manager (DWM API) [DllImport( "dwmapi.dll" )] static extern void DwmIsCompositionEnabled( ref bool pfEnabled ); [D...

How to prevent flickering in ListView when updating a single ListViewItem's text?

All I want is to update an ListViewItem's text whithout seeing any flickering. This is my code for updating (called several times): listView.BeginUpdate(); listViewItem.SubItems[0].Text = state.ToString(); // update the state listViewItem.SubItems[1].Text = progress.ToString(); // update the progress listView.EndUpdate(); I've see...

"Error Creating Window Handle"

We're working on a very large .NET WinForms composite application - not CAB, but a similar home grown framework. We're running in a Citrix and RDP environment running on Windows Server 2003. We're starting to run into random and difficult to reproduct "Error creating window handle" error that seems to be an old fashion handle leak in...