winforms

Making WinForms controls readonly and IDisposable

Hi, I'm wondering whether this is a good thing or a bad thing and what I have to watchout for when calling Dispose. I have a Tab (PageTab) that I extend and insert a Panel which has a listview and another Toolbar control into. These tabs then get inserted into a tab control (all native .NET WinForms controls). When the user closes on...

Correct implementation of an indexer on a derived class

I have a class, say DerivedBindingList<T>, which is derived from BindingList<T>. I would like to use an indexer with the derived class, and have coded it as: public T this[int index] { get { // Getter code } set { // Setter code ...

Place WinForm On Bottom-Right

Hi, how can I place a WinForm (C#) at the bottom-right of the screen when it pop-up? thanks Lennie ...

Split wmv/wav file in WinForms application

I have a Windows Forms application, and I use an instance of Windows Media Player (via WMPLib) to play some audio/video files, either wmv or wav format. What I currently need to do is split the original file and "extract" one ore more clips from it, let's say 3-4 seconds from a specific point in time of the file. Any ideas how to do thi...

C# Update Form from threading & class

I working on project and have problem with threading and update of UI. I read many post around web and this site, but didnt find answer to my problem. I making program that a waiting for some UDP data on port XXXX. Looping in separated thread. When data come he extract information and put it in buffer, and go back wait another data. Ano...

Show input dialog in WinForms

I'd like to show an input modal in my WinForm application. I have looked around the web, but haven't found a good pattern for doing this. I understand I'd have to create another Form, and use the ShowDialog method. ...

How to get the robocopy(or other cmd program) output in a WINForm?

Hi All I have a GUI program, which would call a cmd in this GUI program. In my case, the GUI call the robocopy to copy the file to a file server.And I want to show the progress in the GUI. So how can I get the output of the robocopy and display it on my GUI. Best Regards, Yongwei Xing ...

information from exe file

I have an exe file simpleservice.exe in the physical path F:\SAMPLEPRODUCT\Bin ,, i need to fetch version number of that exe file,,Can you give the code required to fetch the version number ...

Creating A New SaveFileDialog

After a lot of thought and consideration, and Google-ing, I'm hell-bent on creating my own SaveFileDialog. But I do not know where to start and since I haven't seen anything around the web, I would like to know if anybody has done this before, and what I should look into, or how I might go about doing this? Any help would be greatly app...

Is there a way to auto-hide a always-on-top modeless dialog when the parent opens a modal dialog?

My C# Winforms app has an always-on-top modeless find dialog. Since the user has access to the parent window while the modeless find dialog is open they can choose to open a modal dialog as well. Since the modeless dialog is always-on-top it obscures the modal dialog, but it is not possible for the user to close the modeless dialog at th...

Winform DataGridView: how enhance DataGridViewCheckBoxColumn?

Hi! I'm looking for a full example where a DataGridViewCheckBoxColomn and DataGridViewCheckBoxCell are extended so that the Checkbox control itself can be accessed. My goal is to redifine the Databinding for each cell. Thanks for you help ...

Add empty entry to combobox bound to entity list

I use a ComboBox which is bound to a List<> of Entities. How can I add a "Not selected" entry to the combobox? Adding null to the list results in empty combobox. ...

How to hide form to make an app display only icon in system tray?

Why doesn't this.Hide() work in Load event handler of a Form? I would liek to hide the form because this is supposed to be an app that displays only icon in system tray. How can I do it? ...

information in registry

AssemblyName.GetAssemblyName("").Version.ToString() will give the version number ,,but i need to get version number from registry registry path is under MY computer -> HKEY_LOCAL_MACHINE->SOFTWARE-> leaf->monitor here current version file is there,,from there we need to fetch version number ...

Esc key event not getting fired in winforms

Hi May know the reason of my Esc key event not getting fired. here is my trail I've two forms form1,form2 in form1 button click event Form2 frm2 = new Form2(); frm2.show(); in form 2 I've an event called private void frm2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) this.Hide(); ...

.NET Windows.Forms: How can I reverse all strings in text boxes whenever one of them changes?

I wrote a program that accepts and outputs Hebrew (i.e. right-to-left) text. In lieu of a Hebrew keyboard, the program has 22 buttons that allow the typing of Hebrew letters into one of the text boxes. (This has nothing to do with the problem, I think.) This program works fine under Windows using Microsoft .NET and Mono. However, in M...

How do I handle painting for a DataGridView's editing control?

I have a DataGridView and I'm drawing TreeView-style dotted lines on the first cell of each row during its RowPostPaint event. When the first cell (which is a DataGridViewTextBoxCell) is in editing mode, the lines aren't drawn. How do I handle painting for the editing control? The standard editing control doesn't have a Paint event, a...

Draw Simple Circle in List box in C#.Net Desktop Application

Hi, i want to draw simple circle of different category size of circle come form database and different size in c#.net for desktop for winforms .. as you saw me how to draw circle using listbox now i want to fill color in List box each circle using another List box when color is defined ....it is multiple color also we can apply .. plea...

WebForms / MVC to a Windows Forms programmer

Hi, First I'd like to make it clear, I'm not looking for a "my tech is better than yours" type of post; this is a real case scenario and I have been faced with this decision. With this in mind, let me explain: We have a WinForms application. It started in the early .NET 1.0 but the first shipping version was using .NET 1.1. There are l...

DataGridViewComboBoxColumn name/value how?

I thought this was simple like in Access. User needs to set the value of one column in a datatable to either 1 or 2. I wanted to present a combobox showing "ONE", "TWO" and setting 1 or 2 behind the scene, like I did lots of times in Access-Forms. On the other side, if the table is shown it shall not show 1 or 2 but the corresponding ...