winforms

Why use a owner window in MessageBox.Show?

MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ). What do I gain by assigning a owner window? ...

How to navigate between fields with Enter Key

My company has a large application written in VB6, and for historical reasons, the application is navigated with the Enter key instead of with the Tab key. I don't know VB6, but I know that they currently set the focus for each control in a big select statement in the Form's KeyUp event if it's an EnterKey. Now we are starting to conve...

.NET 2.0 WinForm: Supporting DPI and Default Font Changes

So I'm trying to figure out how the Form's AutoScaleMode property can possibly help to support a system with a font or DPI that is different from my work development machine. From the SDK: AutoScaleMode Enumeration public enum AutoScaleMode None Automatic scaling is disabled. Font Controls scale relative to the ...

Can someone recomend example of Lazy Grid implementation in .NET 2.0+?

To improve performance/scalability of a WinForms app, I would like to defer calculation of fields that are not visible in the grid until they are needed. Looking for ideas on how this can be done in .NET 2.0. One idea inspired by this post is to attach a DataSource object that supports ITypedList. However ITypedList interface seems...

Winforms app like google chrome with multiple processes

Is there anyway to use C# to build a container app where each tab is actually its own process like with Google chrome. ...

.net publishing

I have a .net application and i published in the local location. while installing from the published location the application need to install in "c:\temp" how can i do this in clickonce method? ...

What navigation control would you choose to use in your application ?

ToolStrip with MenuStrip or RibbonBar? ...

How to detect applicaton activation

I need to perform some action when my application receives focus. I've tried hooking both GotFocus- and Enter-events, but they only trigger when focus changes within my application. Scenario is that my application detects some problem that must be resolved elsewhere, and I would like to do the check again when the user goes back to m...

What is the best way to display one value and store another on .net comboboxes?

I can't seem to find an easy to use, .net native way to get Comboboxes on .net winforms to display one value and return another based on the selection without creating my own helper class, with the knowledge that winforms is going to display the ToString method on the object that you put in it. This is how I'm doing it now, very generic...

How to make a window have taskbar text but no title bar

How can I make my window not have a title bar but appear in the task bar with some descriptive text? If you set the Form's .Text property then .net gives it a title bar, which I don't want. this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; ...

Silverlight Hosted in Winforms

I would like to host a silverlight control in winforms via a winforms browser, but for it to work I need some way for the forms to talk to the silverlight, and also the other way around. Would it be possible to somehow have the two interact with each other using JavaScript as a middleman? I.e., have the form speak to the browser's java...

What is the best way to display and edit a large array of hex data in WinForms?

I am looking to display an array from 128 to 512 bytes in size of hexadecimal data (0x00 to 0xFF) in a 16 X n grid-like display. It needs the capability of selecting a single element or group of elements and highlighting the data in some way. It also needs to allow editing. I'm writing this in C# 3,5 using Winforms. I'm considering s...

What, if any, printable character did a user type based on the values in a given System.Windows.Forms.KeyEventArgs?

As a workaround for a problem, I think I have to handle KeyDown events to get the printable character the user actually typed. KeyDown supplies me with a KeyEventArgs object with the properities KeyCode, KeyData, KeyValue, Modifiers, Alt, Shift, Control. My first attempt was just to consider the KeyCode to be the ascii code, but KeyCod...

winforms map with links . .

we have users in each region of the world. I would like to create an environment picker that shows up a map on the form and has a link for each region. So if i was in NY i would click NY and would get the NY environment. Any ideas of doing this dynamically in winforms as opposed to having a static map image. ...

How to show compulsory fields on a windows form

How should I show users which fields are compulsory in a windows forms application. I have considered changing the label color or maybe the background color of the text box. I use an error provider to show a red exclamation mark next to the field, however this is only visible after they have clicked the save button. ...

How to dynamically set which properties get bound to a DataGridView?

My DataGridView needs to support a number of types and these types may have any number of public properties, not all of which I want to display. Can anyone suggest a way to dynamically customise a DataGridView's columns when binding a class a datasource? Is there an attribute that will tell a control whether to use a property as a colum...

Winforms - Dynamic Load / Save Settings

I have a "settings file" in my Winforms application called Settings.settings with a partial class for custom methods, etc. Is there a way to load / save dynamic settings based on arbitrary keys? For example, I have some ListViews in my application in which I want to save / load the column widths; Instead of creating a width setting for ...

Tabs in their own process with C# and WinForms

Both IE8 and Google Chrome browser have separate processes for each tab that is opened. For example, you launch IE8 and open Yahoo and Google in their own tabs, you end up with 3 processes running on your system: IE8 itself process [master process] Google tab process Yahoo tab process I'm toying with the idea of a similar thing i...

How can you get a ComboBox child of a DataGridView to process all keys, including "."?

I have the same problem as described in the posts listed below. That is, certain keys don't work at all when I type them into my combobox until I first hit the spacebar. One of the keys is ".", but another is the letter "Q", and there are others: "$", "%". http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=659716&SiteID=1 h...

ClickOnce and IsolatedStorage

The Winform application is release with ClickOnce in our Intranet. We store personal preference for the GUI in the Isolated Storage. All works pretty fine :) The problem is when we have a new version of the application, we publish... all preferences are lost! User need to setup their preference over and over each version. Is there a wa...