winforms

Zoom for a windows form in C#

Is there an easy way to set the zoom level for a windows form in C#? In VBA there was a zoom property of the form. ...

VB.NET form Height Question

I have a VB6.0 project and I want to convert it in VB.Net. In my VB6.0 application some of the MDI Child form’s height is 17000 and width is 13000. Now I want to set the same form size in VB.Net forms, but it allows maximum form width = 1036, height = 780 for resolution 1024x768. How can I increase form size with same resolution? Also...

Is there a standard way to return values from custom dialogs in Windows Forms?

So right now my project has a few custom dialogs that do things like prompt the user for his birthday, or whatever. Right now they're just doing things like setting a this.Birthday property once they get an answer (which is of type DateTime?, with the null indicating a "Cancel"). Then the caller inspects the Birthday property of the dial...

Font-dependent control positioning

I'd like to use Segoe UI 9 pt on Vista, and Tahoma 8 pt on Windows XP/etc. (Actually, I'd settle for Segoe UI on both, but my users probably don't have it installed.) But, these being quite different, they really screw up the layout of my forms. So... is there a good way to deal with this? An example: I have a Label, with some blank spa...

How do you return the focus to the last used control after clicking a button in a winform app?

I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default the focus goes to the clicked button so the user has to click back on to the control they want to edit in order...

Displaying XML data in a Winforms control

I would like to display details of an xml error log to a user in a winforms application and am looking for the best control to do the job. The error data contains all of the sever variables at the time that the error occurred. These have been formatted into an XML document that looks something to the effect of: <error> <serverVaria...

Where can I get free Vista style developer graphics?

What is the best source of free Vista style graphics for application development? I want 32x32 and 16x16 that I can use in a Winforms application. ...

Why does TreeNodeCollection not implenent IEnumerable<TreeNode>?

TreeNodeCollection, like some of the other control collections in System.Windows.Forms, implements IEnumerable. Is there any design reason behind this or is it just a hangover from the days before generics? ...

Roaming settings with LocalFileSettingsProvider

On my way through whipping up a Windows Forms application I thought it might have been a good idea to use the settings file to store miscellaneous application options (instead of the registry) and user parameters (window positions, column orderings, etc.). Out of the box, quick and simple, or so I thought. All works as per MSDN using th...

What is the best winform UI component set?

I've been looking for a commercial winform UI component set for a while now. I've looked at most of the big players out there and I think I'm going to spend my cash on the Developer Express DXperience package. It's not cheap, but does a lot of great things like integrated printing and reporting, a good spell checker implementation, etc...

Positioning controls in the middle of a CheckBox

THis is a followup to my previous question "Font-dependent control positioning." It's an attempt to solve the real problem behind that question, perhaps in ways different than the one I was asking about. Example of the problem statement: I want a checkbox that says "Adjust prices by <X> <Y> after loading," where <X> is a number---adjust...

C# WinForms - DataGridView/SQL Compact - Negative integer in primary key column

I'm just getting dirty in WinForms, and I've discovered, through a lovely tutorial, the magic of dragging a database table onto the design view of my main form. So, all is lovely, I've got my DataGridView with all of the columns represented beautifully. BUT... When I run my application against this brand new, empty .sdf (empty save for...

What is the best way to create a wizard in C# 2.0?

I have a winforms application where users will be creating stock items, and a time of creation there are a number of different things that need to happen. I think the UI for this should probably be a wizard of some kind, but I'm unsure as to the best way to achieve this. I have seen a couple of 3rd party Wizard controls, and I have also...

How can I control checkboxes in a .Net Forms.TreeView?

I have a .Net desktop application with a TreeView as one of the UI elements. I want to be able to multi-select that TreeView, only that isn't supported at all. So I'm adding check-boxes to the tree, My problem is that only some items are selectable, and those that aren't can't consistently cascade selections. Is there any way to disa...

How to store passwords in Winforms application?

I have some code like this in a winforms app I was writing to query a user's mail box Storage Quota. DirectoryEntry mbstore = new DirectoryEntry( @"LDAP://" + strhome, m_serviceaccount, [m_pwd], AuthenticationTypes.Secure); No matter what approach I tried (like SecureString), I am easily able to see the pass...

How do I close a parent Form from child form in Windows Forms 2.0?

I have a need to close a parent form from within child form from a Windows application. What would be the best way to do this? ...

Recommendation for 3rd party editing/syntax highlighting control - WinForms.

I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are: 1) Stability 2) Value (price) 3) Ability to easily customize syntax to highlight 4) Light weight ...

Customizing Visual Studio

I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#) for several months now. For the most part my IDE is set up fairly standard but I have been wondering what are some suggestions in terms of plugins/settings that you find to be the most useful? Update: Thanks for all the great suggestions. It look...

.Net [Windows] TreeView TreeNode does not retain color change after drag and drop

I have a form with 2 tree views, the user can drag and drop a node from one to another. After a node has been dragged and dropped, I change the color[highlight] of the source node in the DragDrop event handles.The color of the node changes fine. But when the users hovers the mouse over the source tree view after that, it flickers and th...

Custom titlebars/chrome in a WinForms app

I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked. Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know that one way to accom...