winforms

WinForms: What happens to the values stored in .resx files?

What happens to the name/value pairs stored inside a form's resx file? Are they compiled into the binary when I compile my project? For my particular project, I would like the ability to edit one of these values manually without recompiling (app.config-style), is there a simple way to do this? EDIT: Some people seem to not be getting ...

How can tooltips be added to a vb.net winforms datagrid row(s)?

I'm looking to add a tooltip to each row in a bound datagrid in vb.net winforms. How can this be done? ...

How do i enable double-buffering of a control using C# (Window forms)?

How do i enable double-buffering of a control using C# (Window forms)? I have a panelcontrol which i am drawing stuff into and also an owner drawn tabcontrol. Both suffer from flicker, so how to enable double-buffering? ...

Does the WinForms WebBrowser control support mhtml content set by the DocumentText property?

Or if any body knows of an alternative control that does? It would be handy to serve up content to the WebBrowser control that has embedded images & other resources from a database without having a dependency on these resources being hosted on a webserver or to create temporary files on the local file system. Mhtml supports this but do...

How to avoid screen flickering when showing form with user drawn controls?

So the transparent background problem is solved. Now, every time I show the form (or have to have it repainted), I get a lot of flickering. Is there any way I can not update the screen until the paint event is complete, or any other way to stop the 1/2 second of flickering and flashing while all the objects are being painted? ANSWER: ...

Raise CellValueChanged from a custom editing control in a DataGridView

I have a DataGridView (WinForms) in which I have defined a custom EditingControl derived from DataGridViewTextBoxEditingControl that only allows numeric characters. I need to raise CellValueChanged event on the DataGridView each time the user press a key, but the default behaviour is to raise the event only when edition has been complet...

Winforms issue - Error creating window handle

We are seeing this error in a winforms application. Can anyone help on why you would see this error and more inportantly how to fix it or avoid it happening. System.ComponentModel.Win32Exception: Error creating window handle. at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp) at System.Windows.Forms.Control.Create...

WinForms: How to customize a tooltip when it is about to be shown?

i want to have a tooltip for each item in a treeview, and each item in a listview, and different for each subitem (i.e. column) in the listview. i can determine the text i want to show (using hit testing with the current mouse position, etc): private void toolTip1_Popup(object sender, PopupEventArgs e) { if (e.AssociatedControl == l...

How do I update a WinForms ListView when using VirtualMode=True?

I have an app with a large ListView which is terribly slow so I'm implementing VirtualMode. MSDN does not seem to cover how I would add and delete new items in the middle of the listview. For example, the ListView has 1000 items (representing files on disk) and after the initial population of the ListView (by the RetrieveVirtualItem eve...

Awesomebar-like behavior with Windows Forms

I'm trying to make a combo box that behaves somewhat like the Firefox 3 Awesomebar, with the following behavior: Type in text Asynchronously bring back results Up and down selects results in the list, BUT leaves the text that was typed in the entry box so the user can continue editing to limit the resultset differently Enter fires an e...

How to make a ComboBox column with two data sources (for DataGridView)

The data sources have the same structure, but different data. One would be used for rows that are saved (view mode), and the other one would be for rows that are being added or edited (edit/new rows). How can that be acomplished? I have a standard foreign key column that references a standard lookup table which has an ID, Name and Activ...

.NET DateTime picker flat style

In .NET 3.0, most controls have a "flat" style. Apparently, the date picker doesn't have such a style but all the other controls in the form are set as flat. How can I make the date picker flat? ...

Detecting running in Main Thread in C# library

Hi! I'm creating a C# dll, which is going to be used by others developers in WinForms. For some reasons, I want to detect, if methods from this library, are called from Main (GUI) Thread and warn developer he has done such a thing (ie. in log file). Is there any reasonable way to detect calling method from main thread? Remember I have no...

Stop the Bell on CTRL-A (WinForms)

Any ideas how to stop the system bell from sounding when CTRL-A is used to select text in a Winforms application? Here's the problem. Create a Winforms project. Place a text box on the form and add the following event handler on the form to allow CTRL-A to select all the text in the textbox (no matter which control has the focus). void...

How do you set the StartPostion of a Windows Forms form using code?

Is there a way to set the StartPosition of a Windows Forms form using code? It seems whatever I try results in the StartPostion being the default. Here is what I am doing in the form to display: public DealsForm() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterParent; } Here is what...

Save Windows Form Size

I'm developing a piece in VB.NET. Inside my primary form, I'm creating a new form to use as a dialog. I was wondering if there was a way to, upon the close of the new dialog, save it's size settings for each user (probably in a file on their machine, through XML or something?) ...

Is there an application to generate Winform Code?

I need a simple app to edit database tables. Are there any code generators that will generate winforms in c#? I have CodeSmith, are there any templates around that would help in doing this? ...

Question about an event perculiarity in a TabControl.

I have a little demonstration below of a peculiar problem. using System; using System.Windows.Forms; namespace WindowsApplication1 { public class TestForm : Form { private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; ...

Winforms Disposing IDisposable

Does anyone have a good articles or tutorial on correctly using dispose and IDisposable. I am trying to explain this to some junior dev and wanted to get some extra material, examples, etc. ...

WPF throwing an exception parsing XAML that includes a Winforms User Control

I have a WPF app that makes use of a Winforms User Control that I have created using C++/CLI. When my app goes to parse the XAML for my main window, it throws an exception. The information appears to be somewhat abbreviated, but it says: A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in Presentation...