winforms

System.Diagnostics.Process.Start("http://google.com") crashes IE

Okay I'm having a brain fart here. This should be simple, but I'm missing something. I've got a win form and I'm trying to launch a web page when I click a button. The code for the button is here: private void button2_Click(object sender, EventArgs e) { try { System.Diagnostics.Process.Start("http://www...

Non-editable combobox in Winforms?

Is there a combobox dropdown style control in Winforms that doesn't let the user to type anything but only pick from the existing list of items? ...

What do you rename Form1 to?

This is pure curiosity... Most 'professionals' will likely never use "Form1" as a valid class name in their Windows Forms projects. I usually end up renaming it to MainForm. What do you do? Edit: For those of you that use hungarian notation (frmMain) - why? I don't think it would still be considered a standard practice... is it? ...

prev next pages for winforms

I'd like to implement the prev/next page behaviour for a winforms app like the browser prev/next pages any existing code samples or guidance on where to start ? I'd assume this is something already implemented and would not like to reinvent the wheel if possible If the sample uses scsf/cab, that would be even better ...

List Name of Controls and Form

I am using visual studio 2003 and Windows platform and i want some tool which give me the list of controls name and control type like button,textbox etc.. in the form is there any way to do this by tool or by any code ? thanks in advance. ...

How to let AutoComplete in .NET Winforms 2.0 TextBox suggest even if the user input is contained in middle of of the suggestion items.

How to let AutoComplete in .NET Winforms 2.0 TextBox suggest even if the user input is contained in middle of the suggestion items? ...

How do I refresh the toolbox in Visual Studio 2008

Working on windows forms in Visual Studio 2008 with C# So I had a windows Form Control that wasn't behaving the way I wanted. So I overloaded the Size property. Bad idea. Everything broke. Horribly. I could not add this control to a form anymore. This was slightly problematic. So I removed the offending code, and recompiled. Pr...

Is there a Form method I can override after all controls are created but visible at design time in .NET?

I'm looking for a method that I can override in my sub classed Form where all the controls inside the Form are already created and visible at design time? I've tried OnHandleCreated() and it works as I expected at run time because I need to loop through all controls in a specific Form and do something to do them. However, I would like t...

Keeping Windows Forms Picturebox in middle of TreeView

I've got a winform with 2 treeviews. my left treeview is being loaded with data from an adserver which is being loaded by clicking on a button. This triggers my backgroundworker which fetches my data and builds up my tree. Now while doing this I'm disabling the treeview control and showing a picturebox with an animated gif on it. So whe...

WinForms Interop, Drag & Drop from WinForms -> WPF

Hello all! I'm trying to drag data from the Winforms portion of my application on a WPF controls that's contained inside an "ElementHost". And it crashes when I try doing so. Trying the same thing but from Winforms to Winforms works fine. (See example code below) I need help on making this work... have any clues what I'm doing wrong? ...

Save file with appropriate extension in a Save File prompt

In my application I use a SaveFileDialog to pop up a Save As window. I have restricted in the file type section the file to be saved as .dat with the following code. sfdialog.Filter = "Data Files (*.dat*)|*.dat*"; What I want to know how to do is make it automatically save with the .dat extension. Currently it just saves with no exten...

Form.Show() moves form position slightly

I have an application with a main form that acts as a sort of frame and an area inside the main form where I open other forms. These forms must not be closed ever so when a new one is opened I use this code to open it for the first time: frm.WindowState = FormWindowState.Maximized; frm.BringToFront(); And then if another form gets ope...

how do I sort Integers in a listview

How do I sort columns of integers in a ListView c#, .net 2.0, Winform System.Windows.Forms.ListView ...

allowing user to choose their own color for form background

how do i give the user a color chooser for the background of a form or anything else? i would like to be able to give him all colors in vb.net ...

how do i set the background color of my form to what the user picks from colordialog?

how do i set the background color of my form to what the user picks from colordialog? ...

i need the icon to disappear after application is closed

my winforms app puts a little icon in the taskbar next to the clock while it's running. how do i make it disappear when i close the program in vb.net? after the application is closed and i put my mouse over it, it disappears. ...

Tabbing to invisible control in WinForms

I have a note editor control in my Windows Forms application: I want to make this control accessible through the keyboard: I want to be able to TAB to it, TAB through the controls, and TAB out of it. Normally this is an easy task, however, the issue is the hidden subject textbox. By design, the subject is editable only when the user ...

How to save logins in a winfrom application?

Hi All, I have a winform application and a list of logins to some web-service. Upon checking 'remember me' I serialize a dictionary into a file along with the encrypted password, but I wonder if this is the best practice to do such a thing or not.. Here's my code public void LoginsInit() { FileStream file = new FileStream(loginsFileP...

C# Designer: Removing redundant code from Design.cs.

Hi, I have a form which has several buttons, labels and other stuff on it, but the designer appears to remember old elements of that form that have previously be deleted. Is there anyway to 'refresh' the form.Designer.cs code to inform it what elements are currently on the form and what elements are not. Cheers for the help in advanc...

How to convert a winforms project to wpf project

I converted a Winforms project by hand-editing the proj file. Changed project type guids and added an application definition section, and now I can add WPF Windows, Pages, etc. to the project. One thing that doesn't work is, the files I added do not have autogenerated cs files, and every new window component are missing their InitializeC...