winforms

How to create a control like Solution Explorer in Visual Studio?

Hi! all. I want to create control that seems and works like Soltion Explorer. I mean not the functionality of solution explorer, the control sholud be seems like that control. That means, server explorer, toolbox, error List,... All these controls will pop-out when we put mouse and pop-in when we leave. we can lock and unlock those co...

what is the latest version of WinForms? And how does this relate the version of .NET?

What is the latest version of WinForms? And how does this relate the version of .NET? For example in VS2008 with .NET 3.5 is there Windows Forms 3.5 under the bonnet? ...

Common Event For Datagridview which is invoked in both case of rowHeaderWidth or ColumnWidthChanged is changed.

Is there any common event for datagridview which is fired, when rowHeaderWidth of datagridview is changed or column Width of datagridview is changed? I have used datagridview.ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e) it is invoked when column width is changed but it is not invoked when row header width of the data...

Is there a way to color tabs of a tabpage in winforms?

I am struggling to find way to color the tab headers of a tabpage in WinForms. There are solutions to color the current indexed tab using OnDrawItem event but can it be possible to color all the tabs with different colors at a time to make them intuitive for user for a certain behavior. Thanks in advance, Rajeev Ranjan Lall ...

TreeView - validating values - BeforeEvent ?

I have a treeView C#. I have the following items A B ->B.1 ->B.2 C D user selects B. Now if the user selects C or any other node I need to some check before leaving the selectiob B. Say i need to call a function and that return a true or a false. if it return a true then the selection can change but if its false the treenode B sh...

C# multi-coloured text in a single cell of a datagridview

Is it possible to change the colour of a sub string present in a datagridview cell? ...

How to implement Mutually exclusive checkboxcolumn in a radcontrols gridview

Hello I use radgridview in my windows application A dataset serves as the datasource for the radcontrols gridview. I have to implement a checkbox column, the selection of which has to be made mutually exclusive. i.e at any given point of time there has to be only one checkbox selected. For this i tried handling the event CellBeginEdit ...

Validation-Textboxes allowing only decimals

hi guys, I am using following code for validating textbox. private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = SingleDecimal(sender, e.KeyChar); } public bool SingleDecimal(System.Object sender, char eChar) { string chkstr = "0123456789."; if (ch...

How to Add window 7 visual style in winform application?

Dear All, I have to change the look and feel of my win form application of .net framework 3.5. So i want to add window 7 theme or visual style, Is any sample application available? and also suggest what to do change look and feel of my application? ...

Using DataAnnotations on Windows Forms project

I recently used ASP.Net MVC with DataAnnotations and was thinking of using the same approach for a Forms project but I'm not sure how to go about it. I have set my attributes but they do not seem to get checked when I click Save. UPDATE: I have used Steve Sanderson's approach which will check for attributes on my class and return a col...

How to show Error & Warning Message Box in .NET/ How to Customize MessageBox

Using C# .NET (Winforms). I want to know how can I show the message boxes with a Ding!! sound & a red colored cross mark in it. This is what I'm talking about: How to do such things for my software, with custom errors and custom warnings? MessageBox.Show("asdf"); doesn't give me customize. ...

Best Practice: Blocking execution while waiting for an Async method

I am trying to adapt an existing program (internally written) to use a different library than it originally did. I've abstracted most of library-specific code away (seems to be the easier part). The issue is, the old library would execute a call using a blocking method, and our internal program is expecting a blocking method to be ca...

Binding: WPF vs WinForms

As far as I know, INotifyPropertyChanges was "invented" before WPF. Could someone please explain what is new in WPF that allowed to do different kinds of binding properties of the control to the properties of objects. Either this was also available in the WinForms but wasn't so popular due to some reasons? (if yes, what is that reasons)...

Only one text box updating with a databound source.

I have a bunch of text boxes bound to table adapters, when I fill my datatable only one box out of all of them will fill, txtEducator (there is only one row in the datatable). They are all configured exactly the same. I have debuged and there is data in most of the fields in the datatable, it just chooses to only show the one field. (I ...

Problem with webBrowser Control.

Hi, I am trying to retrieve data from a page wich first requires to log on, I am using a webControl on a c# winform, and when I try to log on an error pops up telling me "Object doesn't support this property or method" in a .js file at cerain line, the method being called is window.external.AutoCompleteSaveForm which I have no Idea ...

How to set up a Windowsforms databound DataGridView such that only x rows are visible?

I need to set up a windows form DataGridView, programmatically bound to a list, such that only 6 rows are visible to the user (i.e. the grid's height is only 6 cells) and a scroll bar appears when there are more than 6 elements in the bound list. All the rows need to be of the same height. Is there a configuration of properties that does...

Proper use of IsDisposed in Windows Forms

Hi, I have a small win form app that consists of a form and a systray icon. When the user closes the app from the systray I get the ObjectDisposedException as some controls (task icon) still try and access the main windows form. I have tried wrapping the code that access the systray in a if(!this.IsDisposed) wrapper, however the check...

Send user input through a windows form

I am looking for a way to pass mouse events through a winform without using Form.TransparencyKey. If there is no simple way to do this, is there a way to send a mouse event to a given window handle using Win32 API? Edit By pass through the winform I do not mean to a parent window, I mean to other applications that reside behind mine. ...

Customized sorting on DataTable in C#?

This is a C# Winform question. I have a DataGridView which is bounded to a DataTable. I construct the DataTable myself, which several DataColumn instances. When the DataTable is bound to the DataGridView, by default, every column is sortable by clicking the headers of the DataGridView. But the sorting behavior is something "by default"....

Determine the specific fallback ResourceSet/Cutlure used by the ResourceManager when lookuping an object

So I have a localized Winforms application with a bunch languages already. Some of those we localized are neutral cultures we fallback too. Everything is setup and working correctly there. In the field we download new resource satellite assemblies on demand (like a poor mans on demand differed download you get from ClickOnce). For logg...