winforms

C#: Where would you put to-and-from-string conversion/translation-functionality?

I have some fairly simple (at least when you skip error checking, event stuff, et cetera) parameter classes. They are "assembled" kind of like this: public interface IParameter { Type ValueType { get; } object Value { get; set; } } public interface IParameter<TValue> : IParameter { new TValue Value { get; set; } } public a...

How to find which control raised an event, while in so called event? Visual C#

I am writing a C# program that takes in a bunch of parameters and does some transformations of data points and then draws them to screen. On one of my forms I have a bunch of TextBoxes that I would all like to perform the same KeyPress event. Before I would just do a switch statement that would just take in the sender for the KeyPress e...

unclipped Winforms user controls ?

Hi All, Is it possible to create a form with controls allowed to draw outside their (client) area? In WPF, this is not only possible but it's even the default: ClipBounds = false;. How can I do the same in WinForms? TIA, ...

How to catch connection timeout exceptions from XSD-generated typed DataSets?

This might be a bit complicated, but bear with me. I have a Windows Forms app. It uses strongly typed DataSets via the XSD designer. I am running data access queries via an asynchronous thread, performed like so: // Calling it in code on the main thread: LoadDataList_WorkerCaller dataDelegate = new LoadDataList_WorkerCaller(LoadDataL...

Security for a winform data?

Hi, What is the best approach to secure winform data? In other words how to secure the data from hacking for winforms c# projects? There is a winform project with 25-30 forms. It stores data to the access DB. If i start writing encryption/decryption logic to all the forms its going to take much time. Is there any .NET dll/technique wh...

How to get TreeView behaviour for TreeNodes that when you check one, it checks all its children TreeNodes?

This is the same as how most apps behave. I thought TreeView worked like that by default. Is there a way to do this, or do I have to get all the children of a TreeNode that's checked and check them myself? This is winforms. ...

How to get the TreeNode under mouse cursor when the mouse is down?

Basically the TreeView has checkboxes, and I am able to get the TreeNode, but it gives me the TreeNode wherever I click on the TreeNode, from it's text to it's checkbox and a little beyond that (to the left). Can I restrict the hittest so I only get a TreeNode if the user click on the checkbox of the TreeNode? ...

C# Sending WM_SETCURSOR to different windows

Hello all, Following on the debate found at Cursor.Current vs. this.Cursor in .Net (C#), I've added to my NativeMethods class the following declarations: static class NativeMethods { [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); public static void SwitchWait...

CSharp .NET 3.5 Windows Form DataBinding ComboBox to a List<>

Hi there, Ok, firstly I have the following code working.. although my question is this; should I code the combobox databinding like the following example, or is there an easier/more efficient way? Firstly, I needed to manipulate the results back from the database to show a more descriptive meaning: (I am using a basic class for the ke...

How Can I move the caret/focus on a selected row and edit it?

I have a DataGridView that I load in unbound mode. When first loaded the edit is set to I have a button where a user can "Add New" Pressing this it will add a new row then I do dgv.Rows[dgv.Rows.Count - 1].Selected = true;" dgv.EditMode = DataGridViewEditMode.EditOnEnter; However the caret focus is elsewhere. I also would like the ...

File transfer using XMPP

I am using Jabbernet DLL to implement a c# based XMPP client with some customizations specific to my project. I want to support file transfers in my XMPP client. From what I could google/read, This can be done using Muzzle DLL that's available. I could not find any documentation/example to do this. Can any one point me to a link/example...

c# winforms validating event not working...

c# winforms validating Event not working when i click on save button it still fire save event unless i have textbox validations.... ...

Furture Details on Vallidating Event not Working....

I have created a custom control that inherit the TextBox, in that control i have override validating event and in validating event i have put validation that checks for the empty field. No when i use that control on my winform and when i click on save button it immediate fires save event.. the validation event of custom control fires an...

Further Details on Vallidating Event not Working....

I have created a custom control that inherit the TextBox, in that control i have override validating event and in validating event i have put validation that checks for the empty field. Now when i use that control on my winform and when i click on save button it immediate fires save event.. the validation event of custom control fires a...

I need to make sure that texbox only accepts this specific format. how do i do that??

Acceptable format putting in textbox : 00-00-mach-0-00 Where, from the left: 00 year 00 project number mach just a tag 0 machine number, must be 1, 2, 3, or 4 00 pressure ...

.net / winforms: remember windows size and location

hello, i have a windowsfroms application with a normal window. now when i close the application and restart it, i want that the main window appears at the same location on my screen with the same size of the moment when it was closed. is there an easy way in winforms to remember the screenlocation and windowsize (and if possible the wi...

Copying data from a Winforms ListView

Is there a way to copy the text of the selected subitem from a ListView in .NET Winforms? ...

Selected row does't update in DataGridView

I have a datatable bound to my datagridview. One of the columns is a DataGridViewCheckBoxColumn. By clicking on a button you should change all checkboxes in the column to true. private void btnPublishAll_Click(object sender, EventArgs e) { for (int j = 0; j < this.dgrView.RowCount; j++) { this.dgrView[7, j].Value = true; } ...

Migrating a WinForms (C#) APP settings to a .config file.

Hi Guys, I want to migrate the settings file I am currently using to appconfig file. At the moment I am trying to make a copy of it but so far I cannot even get it to write to the file using the Config' Manager. What I need to do is first create the file and then write to it and finally of it already exists, update it!. Seems pretty si...

Why a RaceOnRCWCleanup error when closing a form with WebBrowser control on it?

VS2008, .NET 2, VB.NET, XP ... I have a Windows form, with a WebBrowser control and a Close button, which just does a Me.Close. The form's cancel button is set to the Close button, so that I can hit ESC to close the form. I set the DocumentText property of the WebBrowser control in the load event, and the HTML displays. Running the ...