winforms

Apply and validate a bound DataGridViewComboBoxCell directly upon selection change

I have a windows forms DataGridView that contains some DataGridViewComboBoxCells that are bound to a source collection using DataSource, DisplayMember and ValueMember properties. Currently the the combobox cell commits the changes (i.e. DataGridView.CellValueChanged is raised) only after I click on another cell and the combobox cell lose...

Exit all forms when one close

Hey. When I say close, I do not speak of the method close(), but when a user hits the close button to the window. I have multiple forms, that show and hide depending on if the user is logged in or about to log in and so on. When the user finaly close one of the forms, I want them all to just exit. Now, when a user closes a form, the prog...

outlook 2007: adding new employees automatically/programmatically?

we have about 300 employees and we are hiring like crazy. is it possible to programmatically add new contacts to every employees' address books as new hires come in? ...

How would I go about taking a snapshot of a portion of my application's window?

I'm currently attempting to take snapshot of a specified portion of my application's window from a specified starting coordinate (which is where my problem comes in). Rectangle bounds = new Rectangle((this.Width/2)-400,(this.Height/2)-200, 800,400); using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppA...

Async Updating of UI when an exception occurs in referenced DLL

Hello All, I have a winapp running with a DLL referenced to it. all the major operations are done in the DLL. I have like 1000 xml files stored in a location which i have to read and store data into another format. From the UI, i click on an import button, the call is passed to the DLL layer which converts one xml after another stored...

winform localization

If there are hundreds of form and 20-30 projects in the application and during localization the number of .resx files generated will be very high. Is there any way to organize the .resx files and satellite assembly? If I move the .resx file to common assembly then the design time support for previewing the form is lost. Is there any st...

Main form's OnLoad override never gets called

Hi, The following problem has me stumped: I have a WinForms application which used to work just fine. On Windows7 however, my MainForm's "Load"-event handler is never invoked. I tried Googleing a bit and found suggestions for checking if the Event was correctly connected to the handler (it was), and secondly to try overriding the OnLoad...

Two datagridviews in one windows form = not possible to save data to the second datagridview

I create a winform I´m adding a datagridview by dragging a table from data sources the result: I´ve got a winform with a datagridview and a bindingnavigator I´m adding a second datagridview to the same winform by dragging another table from data sources the result: same as bullet 3, but now with two datagridviews; a second bindingnaviga...

Open Url sending POST

I have the this function which it has been written in html. you put a md5 value in the textbox and hit the button to start searching. <form action="http://www.virustotal.com/vt/en/consultamd5" method="post"> <input name="hash" > <input type="submit" value="get MD5"> My question is how do I do the something like the htm...

How to format DateTime columns in DataGridView?

Hello, I'm using a DataGridView with object data binding to display information about logging entities in a system, retrieved via SOAP from a remote service. One of the columns is called "Last action" and means the last time the entity logged a message. It is a System.DateTime value. When I read the SOAP response (example below), he time...

How to get cell value change when closing form?

Hi, I have a form with a DataGridView on it. In this DataGridView there is a DataGridViewComboBoxColumn. When changing the value of a cell of this DataGridViewComboBoxColumn, the CellValueChanged-event is only fired when leaving the cell (for example, if I click into another cell). The event is not fired when I change the value and the...

FindForm and WPF

I have an application that has a WinForm(myForm). In that WinForm there are a WPF UserControl(myWPF). In that WPF UserControl there are a WinForm UserControl(myWinCtrl). The myWinCtrl has a custom WinGrid(myWinGrid). myWinGrid does internally a this.FindForm() and.... does not find myForm... Is there a way to override the FindForm ...

Bind multiple ComboBox on a form C#

This seems like a simple task but there may be an easier way. I have a form with 30 comboboxes that all need the same data set. Currently I bind each one: DataTable t = GetData(); this.ComboBox1.DataSource = t; this.ComboBox1.DisplayMember = "heading"; this.ComboBox2.DataSource = t; this.ComboBox2.DisplayMember = "heading"; this.Co...

EF4 to datagrid with a combo box as a column in winforms

i have list of entities and i need to bind it to a datagrid...one of the properties in the list is a collection and i need to bind that to an combo box within a datagrid..i am new to windows forms... var list = (from p in db.persons select new person{p.firstname,p.lastname,p.phonenumbers}).tolist() i need phone numbers b...

winforms control real client area

Hello folks: How can I know the real client area of a control? I have an app with a treeview. I do some low level manipulation to this treeview and I need to know the real client area of the control. So far I have used TreeView.Height/Width, but when the tree grows and a horizontal or vertical scroll bar appears, some of this space is ...

How to debug TreeNodeCollection

The code in question: TreeNode categoryNode = categories.Nodes[category]; //BREAKPOINT HERE categoryNode.Add("New Node") My question is less about the code itself (it all makes sense to me), so much as the debugger. When at the break point I want to look at the TreeNodes in categories.Nodes, but categories.Nodes is a TreeNodeCollecti...

What GUI toolkit should I use

I have a C# application. Currently all modules are written in .NET 2 and it uses some executables that have linux ports. So I was wondering what toolkit should I use on Windows and MacOS to compile it max easy on both? On Windows Some guys told me that on Windows I can use WinForms, but on Mac I must use MonoMac, but the transition is ha...

Windows Forms program runs smoth on win7 but on previous os's give the "Index was outside the bounds of the array" Error?

I have a Windows Forms program that runs smooth on win7 but on previous version of windows give the "Index was outside the bounds of the array" error in the imageList call when setting the key-image of the component. Why this can be hapening? PS: This only occur when running the .exe, not when debugging. ...

A simple C# question I hope! Add additional properties to Buttons

hi on a windows form (not WPF) I dynamically create buttons on a flowlayout and I would like to add some properties to them simply to store other values (int and string) with the buttons for latter use. Button bn = new Button(); bn.Text = "mybutton"; bn.Name = "mybutton"; toolTip1.SetT...

Showing current/selected item in ListView in WinForms

I have a ListView with about 400 entries. I need to search thru it for a value and when found I'm setting it to Selected and I would like ListView to somehow scroll to this item and show it on the screen. How can I do this? Will setting .Focused do it? foreach (ListViewItem item in someListView.Items) { string varID...