winforms

How do you include a cursor (caret) in a custom control?

I've been assigned to make a custom grid control in C# with windows forms. One thing I'm unsure of is how to handle showing a blinking cursor (caret) to indicate where cell editing is taking place and the next character will be shown. Does anyone know how this is done with the standard textbox? Is there a standard framework construct t...

Is it possible to add images to treeview nodes without using a ImageList?

(Using WinForms and C#. -> .Net 2.0) I am adding nodes to a TreeView based on data in a table. As well as the caption to appear on the node, that data also contains Bitmaps. I would like to use the Bitmap from the table as the icon on the TreeViewNode, not one from a pre-existing ImageList. (Normally you designate a Key or an Index of ...

SelectedItem/Index/ValueChanged events not raised when DataSource is Databound on ComboBox

Hi, I am trying to implement the following: Two combo boxes on a Winforms form, the first has a list of parent categories, the second is children of the parent, the child list changes contents depending on the selection in the parent. I'm trying to do this properly using databinding but I'm finding a strange quirk with the ComboBox con...

How can I set a DateTimePicker control to a specific date?

How can I set a DateTimePicker control to a specific date (yesterday's date) in C# .NET 2.0? ...

Effective way of making negative of image without external dlls

Hello, That is the solution to make a negative from a image in C# Windows Forms without any dlls and in a effective, fast way? ...

Place a CheckBox in a ListViewSubItem

I'm trying to create a WinForms ListView control with 6 columns. The first two columns will have text in them, but I want the last for columns to have a checkbox in them. I know how to add a ListViewSubItem with text (did this for the second column), but how do you insert a CheckBox? ...

C#: I want to pass messages like a file path to my forms application like a console application, how would I do that?

C#: I want to pass messages like a file path to my forms application like a console application, how would I do that? I was told I needed to find my main method to add string[] args, but I wouldn't know which one that would be in Windows Forms. Which would my main method be in C# windows forms application? ...

Binding a custom serializable object to controls so user and load/save preferences

Ok, so having given up on getting the built in .NET configuration system to save/load data about a custom object per user, I have moved to using a serializable object. And, to go a step further, I'd like to bind it to my controls in the options window of my application. Please forgive the length of this question as it has some chunks of...

DateTimePicker control usage in specific scenario

This question is relating to a specific functionality that a client has requested for an application I am designing. Basically, the client wants the DateTimePicker to prompt a question after the date was selected. This sounds simple, however, I am having difficulties accomplishing this simple task. If I prompt OnCloseUp - Keyboard ...

Embedding a File Explorer instance in a WinForms app form

My (C#, .NET 3.5) app generates files and, in addition to raising events that can be caught and reacted to, I want to display the target folder to the user in a form. The file-list is being shown within the same form as other information. I'm using an instance of the WebBrowser control (System.Windows.Forms.WebBrowser), then navigating...

Dynamic WinForm aka questionnaire

I am in the process of converting a ASP.Net Web App to a C# WinForm App. I am struggling converting a specific page. This page is a questionnaire where each answer(usually rdo) determines what the next question will be. I originally had thought to just have all questions displayed and set the read-only property accordingly. Unfortu...

Viewing Time using the Infragistics UltraDateTimeEditor for WinForms

By default the UltraDateTimeEditor displays just the date. What setting do I change to display/set the time in addition to the date? ...

.NET: How to have Escape close a MessageBox.Show()?

Assuming the code: MessageBox.Show(this, "Would you like the differential girdle spring on the up-end of the grammeters?", "Smi-Boloid Stater Slots", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); If the user presses Escape, i want it to close the message box, and the Show() method can return Dialo...

IE hosted windows control with dependent assemblies

I am working with a windows forms user control that needs to be hosted in Internet Explorer. Info about the technique I am trying to duplicate can be found here and here. However, the control fails to load in the browser because it relies on multiple other dependant dll’s. Is there a way to get the dependent assemblies to be downloade...

Add Controls to WinForms dynamically in another Thread

Hi all, I have a Winform that contains a datagridview, bindingsource, file explorer control, etc... I need add several controls (Custom UserControls) to a Panel dynamically (like Panel.Controls.Add(...)). This process can be slow. I want to show to the user a message (waiting). What is the best way? I use Backgroundworker but I have...

Custom Class for dealing with embedding in Forms

I have a custom class file in C# that I inherited and partially extended. I am trying to re factor it now as I have just enough knowhow to know that with something like generics(I think) I could greatly condense this class. As an inexperienced solo dev I would greatly appreciate any direction or constructive critism any can provide. ...

ToolStripProfessionalRenderer for Visual Studio 2008 Look-and-Feel

I came across this link today that offers a ToolStripProfessionalRenderer implementation for the Office 2007 look-and-feel. From what I can tell, it would be fairly straightforward (albeit tedious) to customize this to support various other themes, such as the silver and black themes of Office 2007. More specifically, I'd like to find ...

Can you turn off visual styles/theming for just a single windows control?

My Windows Forms application uses the following standard line of code so that visual styles (theming) is enabled for the entire application... Application.EnableVisualStyles(); ...which works just fine, all the controls have a themed appearance instead of the flat battleship gray that you would get otherwise. But I need to turn off vi...

Custom .ttf fonts to use in C# windows.Form

How do I use a custom .tff font file I have with my current windows.forms application? I read some where that I use it as an embedded resource, but how do I set it the System.Drawing.Font type? ...

How do I test localization in a winforms application?

Is there a way to test different languages in a Windows application without changing the localization of the OS or adding code to the application to forcibly change the current culture? Perhaps some type of a launcher that will launch the application with a specified culture? ...