winforms

Weak references

can someone explain the main benefits of different types of references in C#, weak references, soft references, phantom references, strong references. We have an application that is consuming a lot of memory and we are trying to determine if this is an area to focus on. ...

Meaning of exception in C# app: "Not a legal OleAut date"?

Does anyone know what this means . . getting this in C# winforms applications ...

How should I pass a reference of an object to a controller in MVC?

I'm trying to get better at using MVC/MVP style patterns with my WinForm apps and I'm struggling with something that maybe someone here with more experience can help me with. Below is my basic project layout: The class G2.cs handles the running of various threads and includes a Start/Stop and other various methods involved with those ...

Any tool that can upgrade .NET 1.1 WinForm code to .NET 2.0 "style"?

I mean a tool that can extract certain contents from old .NET 1.1 WinForm code and put it in .designer file (make it looks like .net 2.0 WinForm code). This also involves an update to the project file (.csproj/.vbproj).. If no existing tool yet, any tip or pointer on how to do this by programming? ...

Start VB.NET GUI app using Sub Main or form startup object?

Is there any reason to start a GUI program (application for Windows) written in VB.NET in the Sub Main of a module rather than directly in a form? EDIT: The program won't take any command line parameters and it will be executed as a GUI program always. ...

How do I store an enum value in a Windows Forms settings file?

I'm using Windows Forms and VS2008. I want to store an enum value in my application's settings file. The settings editor in VS2008 only gives me a limited set of types. Amazingly, enums don't seem to be one of these types that are automatically supported - have I understood this correctly? From reading up on the subject, it seems lik...

ideal design for winforms connecting to SQL Server . .

I have a winforms application that is doing the following: on each query: Db connect Db query Db disconnect as we are trying to avoid having to keep the db connection open. This suffers from performance as we have to connect / disconnect everytime. What is the idealized model here to have the fastest performance but without having...

Windows Forms ProgressBar: Easiest way to start/stop marquee?

I am using C# and Windows Forms. I have a normal progress bar working fine in the program, but now I have another operation where the duration cannot be easily calculated. I would like to display a progress bar but don't know the best way to start/stop the scrolling marquee. I was hoping for something as simple as setting the marquee spe...

Pass value to form in .Net

I want to pass an integer value to a form in .Net so that it can load the right data. I'm using this so that when I double click on a record in a list, a form opens with the data from that record loaded so it can be edited. What is the best way to do this? Should I create a property and set it before calling the Show() method, or should ...

Migrate VB.NET 2.0 Winform to 3.5 WPF

Is it possible to migrate a VB.NET Winform solution to a 3.5 WPF solution. If so, any suggestions how to do it? Thanks in advance! JFV ...

How to prevent a Winforms control from listening to the keyboard ...

For a certain inputform, I'd like to make it possible to do input with the keyboard. I know how to read the keys through KeyPressed and KeyUp, but the problem is that when a control has got the focus and the user presses the Enter key, that control receives the a Click event. Is it possible to prevent that behaviour ? Or is it possibl...

How to modify PropertyGrid at runtime (add/remove property and dynamic types/enums)

How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add "dynamic types", what I mean with that is a type that result in a runtime generated dropdown in the propertygrid using a TypeConverter. I have actually been able to do both those things (add/remove properties and add dynamic ...

WindowsForms designer and GenericForm

Why doesn't the designer work if you inherit from an own written genericform? Suppose I've got the following genericform public class GenericForm<T> : System.Windows.Forms.Form { public T Test { get; set; } } When I go to the designer I get errors. The only workaround I made up is using compiler directive...

Which event raise on cell value change in Infragistic UltraGrid ?

I am using Infragistic UltraGrid in window application. I need a event which is raised on cell value change. I try many events like AfterCellActivate,AfterCellUpdate but uanble to find right one. Please suggest me. ...

Converting winform from XP to Vista - Properties.Settings

I'm upgrading an app with many different settings files from XP to Vista and changing location of the files to use the Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) line rather than write to application path. There are values used in mannnny places from property settings. Those values are getting assigned from v...

Which event raise on check change of checkbox in Infragistic UltraGrid ?

I am using Infragistic UltraGrid in window application. I need a event which is raised on check change of checkbox in Infragistic UltraGrid. ...

Tab Index in Windows Forms

In my current application I have a form that requires the user to enter TONS of data. There are about 30 Textboxes and it happens that during development new ones get introduced or old ones get kicked out. One Requirement by my customer is that they are all navigable through pressing Tab, and so I'm currently at the mercy of the TabInde...

Making the window [X] button close instead of minimise on Windows Moblie

The [x] button in the top bar of a window that normally closes the window in standard Windows, appears to do a minimise instead on Windows Compact. How do it make it close instead? I need to also be able to raise an event when this happens as I want to preform some logic on window close. ...

Get the combobox text in C#

I filled up a combobox with the values from an Enum. Now a combobox is text right? So I'm using a getter and a setter. I'm having problems reading the text. Here's the code: public BookType type { get { return (BookType)Enum.Parse(typeof(BookType), this.typeComboBox.Text); } set { this.typeComboBox...

How to override background color for WinForm minimize and maximize buttons

Is it possible to override the background color of the minimize and maximized buttons in WinForms? ...