winforms

Dynamic control in c#

I want to create a kind of 4 x 3 matrix with textboxes and checkboxes. Whether the element is checkbox or textbox depends upon the values in database.I want it to be dynamic. What is the best way to start? // something like this but I need to fill in each elements of the matrix... private void CreateSpecificControl(string requestedTy...

how to do Hit testing in GDI+ ?

I have a canvas that contains many shapes and every shape has a location, size and rotation angle (size and location are in inches) and I want to check if mouse position is within which shape (the rotated shape) ?? can anyone help? ...

Design-Time Tutorials

I am looking for some (preferably) online tutorials on making controls with 'Rich design-time support' By Rich design time support i mean like how the menustrip works on a form and such. Any links to websites, good books or code samples (c# or vb.net) would be great. ...

Run a .NET program from a mapped drive or shared folder - Pros/Cons

This may be a silly question for some of you, but what are Pros/Cons of running a Windows Forms .Net application from a shared drive. Up until recently I didn't even know this was possible. From research it looks like .Net 3 SP1 allows this behavior (without requiring any security changes). I am curious as to any concurrency issues or ...

How to force Buttons, TextBoxes to repaint on form after a MessageBox closes in C#

I have a form with buttons, textBoxes and userControls on it. When a button is clicked, it calls a method in another class. In this class a Message box opens. When user clicks OK, the messageBox closes, and the class method proceeds for 10 or so seconds before ending. During this 10 seconds, what ever textBox, or button the message b...

Is it possible to reuse a .NET WinForms Form object?

Once a window has been closed, it is possible, and it is recommended, to reuse that window's Form instance to show the same window again? Or is it required or recommended to always create a brand new instance of the class when you will be showing a window. What this really boils down to is whether it is a good idea to ever call Show() ...

textBoxEmployeeName vs employeeNameTextBox

Which naming convention do you use and why? I like to use employeeNameTextBox, because: It seems more natural from an English language perspective. I find it's easier to look up with Intellisense. The convention is similar to the convention used for events (MouseClickEvent, MouseClickEventHandler) and dependency properties (VisiblityP...

How to Asynchronously fetch AutoComplete data for a TextBox?

Our WinForms application does lazy loading of the data for auto complete of a textbox. The pseudocode for this is as follows; User types in TextBox On typing pause, determine if we need to fetch the auto complete data In worker thread, contact the server and fetch data Invoke back to the UI thread Set textBox.AutoCompleteCustomSource ...

How do I detect if jQuery is in a document navigated to in the WinForm WebBrowser control?

I have a Windows Forms application in C#/Visual Studio 2008 with an IE WebBrowser control. In the DocumentCompleted event, I want to search the WebBrowser.Document or WebBrowser.DomDocument to see if jQuery is already present in the page. What's a good way to accomplish this? Thanks! ...

How do I get all strings from a Form for localization?

All articles I've read about localization of a WinForms application assume that I already have all the strings translated. According to the articles, I should just set the Localizable property to true and edit all the controls. But how do I get all the original (English) strings from the form? Assume I have a complete application, which...

Windows Forms Databinding DisplayMember a Custom Class's Child Property

I'm trying to set the DisplayMember Property of my ListBox in a windows forms project to a property of a nested class inside a Generic List I am binding to. Here's a simple example: public class Security { public int SecurityId { get; set;} public SecurityInfo Info { get; set;} } public class SecurityInfo { public ...

how did you or do you handle the DataGridCell edit events in WinForm Datagrid .Net 1.1?

Since Winform Datagrid in .net 1.1 lacks of cell edit events like Datagridview in 2.0. i am wondering if there are certain workaounds in order to add validation events when users finishing editing a cell in a datagrid. wishing our customer to let us upgrade his apps to 2.0 at least ...

How to embed a Java control on a C# winforms control?

Can I put a Java control (SWT, Swing, ...) on a C# control? I know it's possible with web controls but I don't like this way. ...

Does Visual Inheritance work in VS2008?

I have a base form. I place Ok and Cancel buttons on the bottom right of the form and anchor them Bottom and Right. The inherited form does not honor the anchor properties of the Ok and Cancel buttons. Here are the exact steps to repro. 1- Create a base form with a button located at bottom/right. Anchor it there at Bottom,Right. 3- ...

How to stop Ideablade DevForce writing to C:\Program Files\AppName\debuglog.xml in Vista

I have an application that uses Ideablade Devforce as it's OR mapper. When the application starts up it wants to write to the debuglog.xml file in C:\Program Files\Application Name\ This works fine in Windows XP, but due to Vista's locked down write access to Program Files, the app throws and error. Is there a way to stop Ideablade want...

Catching exceptions thrown by plugin UserControl

I am writing a WinForms application that accepts dynamic user interface controls, in the form of plugins (think widgets). For this, the main function of each plugin returns a UserControl that is then added to the main form. Since my application doesn't have direct control over them, I would like to "sandbox" the plugins exception-wise s...

Detect change of resolution c# WinForms

Hello, is there an easy way to hook to an event that is triggered on change of global screen resolution? Thanks in advance Matze ...

WPF vs WinForms or Rich UI vs Stable Applications? What do you think about the future of the Windows Forms platform?

WPF vs WinForms. What do you think about the future of the Windows Forms platform? ...

How to overlay or watermark a picture in windows media player

I working on a distributed mediaplayer that uses the windows media player component. Now the customer asks me if its possible to have their logo overlayed on the media played instead of them having to render every movie with the logotype. I have google it and it seems like I can use a directshow filter to do this, but I havent found any...

Changing default font in Windows messes up my Win Forms buttons.

We have a collection of C# (.NET 2.0) applications that have custom dialog windows. When the user changes the default font size and resolution etc in Windows the edges of the form lose controls (they get pushed off the visible portion of the form) typically dropping off buttons from the bottom. This is problematic for us and will cause i...