winforms

Positioning problem in VIsta when Aero Theme is enabled

Hi, I have a Windows form which has tab pages. On a Tab Page, I have a Combo Box. When I click the combobox a drop down opens up just below the combo box to give the impression of a drop down. The drop down is a windows form and this is how I set its position Popup.Location = control.PointToScreen(parentcontrol.PointToClient(new Sys...

Winform Databinding persist invalid data

I have a winform with a few textboxes databound to an object like so tbdecimalProp.DataBindings.Add("Text", activeUserInput, "decimalProp") One of the properties I bound to is type Decimal. When the user enters text into textbox, and the control is validated, the users input is lost, and the value in the textbox reverts to what it was b...

Embedding User Controls a bad idea?

I am embedding usercontrols in a panel and using DevExpress Navigator control to navigate from one to the other. What I am concered about is any implications to this method? I would give examples of what I am concerned about but then I wouldn't need to ask this question... I have a primary form, ShellForm that has a docked Navigator...

.NET WinForms DataBinding - BindingList<IBindableItem> where some implementations of IBindableItem may also implement IList

This is related to another question of mine, and unfortunately I'm having a difficult time summarizing the issue in my Title--so please bear with me. I've created a databindable class called Folder which implements a ITreeItem interface and inherits from BindingList<ITreeItem>. I have a second class, TreeLeaf, which is a leaf in the tr...

C# user controls in a panel not receiving events

I'm working on a project that is requiring me to add multiple user controls to a panel. What I would like to do with these custom controls is highlight the currently selected control and low-light the others. My problem is that my custom controls aren't receiving the GotFocus/LostFocus messages. Am I missing something here? This is how ...

Event when a Window gets maximized/"un-maximized"?

Is there an Event that is fired when you maximize a WinForms Form or "un-maximize" it again? Before you say "Resize" or "SizeChanged": Those get only fired if the Size actually changes. If your window happens to be equal in size to the maximized window, they do not fire. Location looks like the next best bet, but that again feels like g...

How to serialize Color property as ARGB values?

I'm working with Windows Forms designer. It serializes properties of type Color as known name whenever possible. I need it to serialize such properties always as RGB, because I need it later for interop with other system, which can deserialize only from RGB values. Is there a way to serialize Color properties always as RGB values? ...

UseCompatibleTextRendering property not created by designer when it is set to false

I do not wish to use compatible text rendering, but I do not wish to use Application.SetCompatibleTextRenderingDefault(false); Naturally, I thought all I had to do was set each label's UseCompatibleTextRendering property to false. The Forms Designer, however, apparently only generates code to set the property if UseCompatibleTextRend...

How to generate event on a specific time of clock in C#?

How can i generate an event on a specific time say i want to generate alert at 8:00 AM that its 8:00 AM and on any given time of clock ...

How do you set the 'look-and-feel' of a winform app hosted in IE to the 'aero' style of controls?

Is there a way to have a windows form app hosted in IE use the 'look-and-feel' of the current OS/browser, similar to how everything looks when the app is run in the debugger? For instance I'm debugging in VS2008 and it looks great, but when I view the app in IE7 or IE8 on Vista or Win7 all the controls look like Netscape navigator circa...

Windows forms app in IE: how to not require the user to modify trusted zones/.net security? Trust?

How do you configure/setup your .dll file so that when its hosted in IE and a user hits the page it just prompts them to 'trust' the application and install it and run? Currently all the doco I can find talks about adding the site to the trusted zone and running "caspol" on the command line to modify your .net security settings, which w...

[C#] Issue when Applying Region to a Form

Hello, I am facing a strange behavior when I apply a non-rectangular region to a Windows Form (lets say an ellipse). The issue is that the form seems to disappear for a moment (as if the region is empty) when initially resized. It looks like a slight flicker whereas the contents of the desktop behind the form become visible for a fracti...

Do any of the .net data classes implement INotifyPropertyChanged?

Short question: Do any of MS's built in Data Objects support INotifyPropertyChanged? Long explination: So I'm going to be displaying alot of data with databound controls. The data is going to be chaging somewhat frequently with user interaction. The application is a basic windows form app. Rather than wire up events for all the data to...

How can set MaxLength for TreeNode Name and text property?

How can set MaxLength for TreeNode Name and text property? This is a windows forms application, where user right clicks a treeview to add a node and the maxlength of the treenode name should be 40 chars. Currently I check this in AfterlabelEdit event, and throw a message if no. of chars exceeds. But the requiremnet says to limit the leng...

How to set the TAB width in a Windows Forms TextBox control?

Given a WinForms TextBox control with MultiLine = true and AcceptsTab == true, how can I set the width of the tab character displayed? I want to use this as a quick and dirty script input box for a plugin. It really doesn't need to be fancy at all, but it would be nice if tabs were not displayed as 8 characters wide... From the accepte...

Disable check/uncheck CheckBox after clicking checkbox`s label

Hi, How can I disable standard behaviour when choosing checkbox`s label. Now when I click on label checkbox change its state. Thanks ...

C# trying to capture the KeyDown event on a form

Hello! I am creating a small game, the game is printed onto a panel on a windows form. Now i want to capture the keydown event to see if its the arrow keys that has been pressed, the problem however is that i can't seem to capture it. Let me explain, on the form i have 4 buttons and various other controls and if the user for instance p...

Loading .net 3.5 wpf-forms in a .net 2.0 application

I'm trying to load and host a WPF control in a .net 2.0 windows forms application. The WPF control should only be loaded if .net 3.5 is installed. I found a link to Hosting WPF Content in an MFC Application and that is about what I'm trying to do but my C++ knowledge isnt sufficient to be able to 'translate' it to .net. Anyway, here is...

Plot ECG in Winforms

i have no previous experience in plotting in winforms, in one form i want to plot ecg. or lets say a sin wave or any wave function in a specific area, but what i am doing is e.c.g.. rest of the form will be normal form with buttons and labels, can anybody be nice enough to through in a tutorial :) ...

Best way to create a standalone program for windows without having to install pre-requisites?

Hello, I've been charged with creating a little GUI launcher app to go on a CD which will offer the user some software and some videos. It's not being aimed at particularly tech-savvy people, so it needs to be quite simple. I guess the real sticking point here is that it will be form based. I would very much like the launcher to just ru...