winforms

C# Class Instantiation Overflow

Scenario I have a C# Win Forms App, where the Main Form contains a loop that creates 3000 Instances of another CLASS (CLASS B). Inside Form B there are a large number of properties and fields and a bunch of methods that do a fair amount of processing. Question Will the creation of 3000 of these classes give me problems? I'm thinking ...

Winforms Controlling Forms

How can i control all my forms from main () Form1 frm1 = new Form1(); Form1 frm2 = new Form1(); Form1 frm3 = new Form1(); Application.Run(frm1); // This way form-control goes to the frm1. // In frm1 i have to write frm1.Clicked += ()=>frm2....

What control simulate the view of ASP.NET DetailsView in Windows Forms?

What is the best solution to display data as in ASP.NET DetailsView control in Windows Forms? ...

Getting Data from WinForms ListView Control

I need to retrieve my data from a ListView control set up in Details mode with 5 columns. I tried using this code: MessageBox.Show(ManageList.SelectedItems(0).Text) And it works, but only for the first selected item (item 0). If I try this: MessageBox.Show(ManageList.SelectedItems(2).Text) I get this error: InvalidArgument=Value ...

C# Button Text Unicode characters.

C# doesn't want to put Unicode characters on buttons. If I put \u2129 in the Text attribute of the button, the button displays the \u2129, not the Unicode character, (example - I chose 2129 because I could see it in the font currently active on the machine). I saw this question before, link text, but the question isn't really answered, ...

Localize node texts in treeview using resource files

For a project I need a tree view that allows the user to select a module, which then is displayed in a content area. The project relies heavily on localization and this is provided by the resource files. Now I discovered today, that the text that are assigned to preset tree view nodes are not contained in the resource files. So the q...

How to build form completion/document merge application with Winforms or WPF?

I need to build an application that accepts user input data (such as name, address, amount, etc.) and then merges it with a pre-loaded document template (order form) and then prints this merged document. I can use Windows Forms or WPF for this project. Any suggestions on how best to approach this? I'm experienced with Winforms develop...

Recover WinForms from dll

We think most of the source has been recovered through .NET Reflector. A utility which export the dll as C# source. The only missing part is WinForms which is not included when .NET Reflector export the dll source. Is there any way to get the WinForms recover from dll? Thanks. ...

After which event should I perform an action after editing a cell in a DataGridView?

I have a WinForms DataGridView control on a form. There are two fields in this DataGridControl: Email Address Resolved Email Address (calculated based on the input in Email Address) After the user inputs or changes a value in Email Address, I want the value in Resolved Email Address to update based on a separate method. What event ...

Creating a custom TabPage control in C#

I'm building a small tabbed c# Form and I'd like each tab page to have some common features, notably, an OK button and an error message and to have a space for the specific form fields. Has anyone else done something similar and how did you approach it? ...

How can I show Form in process1 from Form in process2 ?

Hi I'm trying to show hidden form in process1 from another one was called by : Process.Start(@"F:\MyOtherFormPath\MyOtherForm.exe",this.Handle.ToInt32()); As you can see i passed the handle number of the hidden form ,which i'm calling the "MyOtherForm" from, and i used this number to get a handle and show the hidden form from my "MyOt...

WinForms "mini-windows"

I need to create some mini-windows, like the ones shown in the image bellow, in my winform main form. It would be nice if they could be draggable, resizable, and, mainly, closable. How can I approach this design? Has anybody already seen some control (with code available) implementing something similar? ...

Linq to Entities strange deploying behavior.

Hi I started building apps with this technology and I am facing a weird problem... on some machines I need to add theese lines to the app.config to get to work: <system.data> <DbProviderFactories> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MyS...

MDI Child form over a graphics

How to show a MDI child form over a graphics control (created from a Panel's CreateGraphics method, for instance) in a MDI Parent control. The MDI Parent graphics control gets over the MDI Child form. ...

WinForms Application Form "Shakes" When Audio Playing

I have a C# game program that i'm developing. it uses sound samples and winsock. when i test run the game most of the audio works fine but from time to time if it is multiple samples being played sequentially the application form shakes a little bit and then goes back to its old position. how do i go about debugging this or present it ...

.NET grouping forms so that pulling up the primary form shows all other forms?

I have an app that can open up some other forms at the user's request, and they're set to not show in the taskbar. The problem is, if one of the secondary windows becomes hidden by another app, switching to the primary window only brings that form to the forefront. Is there a good way to "group" the forms so that giving any of them focu...

How can you determine when the user scrolls to the bottom of a DataGridView?

I am writing a C# Windows Forms Application in Visual Studio 2008. I have a DataGridView with a lot of data in it. I would like to initially only populate 10,000 rows and add more only when the user scrolls to the bottom. I am handling the DataGridView's Scroll event, but it never seems to raise with the ScrollEventArgs.Type property set...

Tool to generate a GUI (WinForms or WPF) from a class.

Say we've got a class like public class Doer { public int Timeout {get;set;} public string DoIt(string input) { string toReturn; // Do something that involves a Timeout return toReturn; } } Is there a tool that would create a Form or Control for prototyping this class? The GUI might have a Num...

Set the Scrollbar width of a DataGridView

I'm working on an app for a mobile device and would like to make a datagrid scrollbar button larger to enhance the touch screen usability. I do not want to alter the system settings windows display properties as this will affect the device as a whole. Is there an easy way to alter the width of the scrollbar on a datagrid view? ...

Winforms TabControl causing spurious Paint events for UserControl

For our project, we've written a WinForms UserControl for graphing. We're seeing some strange behavior when our control is sited in a TabControl - our control continuously fires Paint events, even when there is absolutely no activity by the user. We only see this in the TabControl. When we site our control in other containers such as ...