winforms

Font 'Times New Roman' does not support style 'Regular'

Anybody hear of this one? System.ArgumentException: Font 'Times New Roman' does not support style 'Regular'. I've got a WinForms app that is deployed via ClickOnce. For some reason a number of users are getting this error. I can see getting this error because of picking a non-standard font, but Times New Roman, Regular? Is there a servi...

Best practices for C# GUI naming conventions?

GUIs, whether written in WinForms or XAML, seem to have the most widely differing naming conventions between projects I see. For a simple TextBox for a person's name, I've seen various naming conventions: TextBox tbName // Hungarian notation TextBox txtName // Alternative Hungarian TextBox NameTextBox // Not even camelCase Text...

.NET TreeView control with checkboxes

The TreeView control has the checkboxes property, but it puts a checkbox on every node. How do I put a checkbox on just the nodes I want? ...

"Impersonated" User Not Propagated To SQL Server 2000

I need to "impersonate" a user in a VB.NET 2008 WinForms application, so that the application can accept the Active Directory login of any user on a PC regardless of who is actually logged in to Windows. I want the application's My.User to be the AD account of the person who logged in to the application. I succeeded in this with the foll...

how to change the color of winform DataGridview header ?

I have tried to do it without success. Is it possible ? ...

how to Creating buttons in a running application (runtime) plus its onlick event funtion using C#?

I want to create buttons or list of items on the basis of number of items in my database or from list of items in my array and for each item create a onclick function for either buttons or any list of items ...

Disable expanding after doubleclick

Hi, Is there any way I can disable expanding TreeNode after doubleclick?? Thanks ...

How to Transferring objects between windows forms in c#

hi , i got a listview in the windows form.When form loads lisview loading with personel objects.I wanna do when some user dclick listview's , gets the personel object from the listview's selecteditem property and open a new form and transfer this object to newly opened form. here is my codes for loading personel objects to listview. ; ...

Winform toolStrip Status Label shows nothing: is this a bug ?

Have an instruction like this: this.toolStripStatusLabel1.Text = this.toolStripStatusLabel1.Text + "; OS=" + System.Environment.OSVersion.ToString(); If I concatenate OS with something that is more than 10 characters text is blank instead of being truncated. Is this a Bug ? ...

Winforms ComboBox autocomplete search multiple parts of string

Very similar question to this one... http://stackoverflow.com/questions/522521/autocomplete-for-combobox-in-wpf-anywhere-in-text-not-just-beginning but my issue is for windows-forms rather than WPF. I have a winforms databound combox working great with autocomplete list coming from the data items in the combobox. Of course the client w...

PictureBox question

Using C#.Net On my form i have a button that opens a dialog which allows a customer to select a picture, when the ok button is clicked the picture should be visible in the ultrapicture box control on the form..Not sure how to achieve this or if its simple a property to be set, any ideas ? ...

Switching Visual Studio to C#?

trying to get my first windows form running with controls. I havent been able to figure anything out. . . and then i realized duh, it's all in VB. How do I switch the generated files to C#? Am I confused? This is what I'm getting when I try to add my first control for Button_Start: Public Class Form1 Private Sub Form1_Load(ByVal se...

windows.form c# moving between forms

I am designing an installer interface for a already written program. It is my first windows.form. I see three approaches to solving my "problem" of needing multiple "screens". I can add all the labels/buttons/interface, and then hide/show them at events. Or I can close and open a new windows? Or do I somehow load my next form into the wi...

Visual studio 2008 folder browser dialog

In visual studio 2008 there is a folder browser dialog that looks like this(very similar to file open dialog): http://img24.imageshack.us/img24/5742/folderbrowser.jpg Does anyone know how to invoke it from code? ...

Proper localization of a WinForms application

I have a WinForms application which I want to translate into multiple languages. However, I do not have any experience with localizing a WinForms app, and I find very contradictory information about this subject. Basically, what I want is: In the source code, I want only one file per language this file gets compiled into the main appl...

Keydown event capturing number keys

Hello, VS 2008 SP1 I want to capture the number keys 0 to 9. And perform some action if those number are clicked. I am using the code below. However, it doesn't seem to be working right. However, the code doesn't go into the switch as when I use the debugger to see what key value has been captured in the e.KeyValue it comes up with "L...

Windows.Forms Visual Studio, How to open a second window directly over the first window?

How can I open a second window directly over the first, and not slightly diagonally down-right or back at the default position? I'm just trying to make a few screens to be clicked through. Is there another way I should be doing this? why doesnt CenterParent do it? What does CenterParent do then? ...

Windows.Forms Visual Studio C# - Why would/should I use a settings windows instead of saving in a file?

Why would/should I use a ".settings" file instead of taking the information and storing it in a flat file? How do I access and modify the settings from this window from my application windows. Do I need to create an instance of the file or is it static? ...

Winforms RichtextBox Bold/Italic/Underline Formatting issue

Hi there, As you can tell from the title, Im having a bit of issue regarding assigning and removing format styles to and from selected text in the RichTexBox control. I know how to make text individually Bold/Italic/Underline, but not a combination of these. I know of ways that can achieve this character by character, but this would se...

Lock a winforms control

I need to ensure that, once the execution hits a method, the control received by this method is not changed by another thread. Basically, I thought in something like this: private void doSomeWork(Control control) { lock (control) { // do some stuff with the control... } } Is this a bad idea? Edit: Actually, what I'm ...