winforms

Windows.Form c# without visual studio

I am trying to learn Windows.Forms, and while I have Visual Studio (edit, my mistake obviously), I feel that I learn much more effectively by doing everything in Notepad. I have searched everywhere for a tutorial that takes this approach. I finally got started with http://www.geekpedia.com/tutorial33_Windows-forms-programming.html, but a...

DataGridView checkbox column - value and functionality

I've added a checkbox column to a datagridview in my C# form. The function needs to be dynamic - you select a customer and that brings up all of their items that could be serviced, and you select which of them you wish to be serviced this time around. Anyway, the code will now add a chckbox to the beginning of the DGV. What I need to kn...

Is it possible to avoid multiple button clicks on a Winform?

Suppose you have a button on a form that counts to 1000 in a textbox and then clears it. If I quickly click the button five times (in runtime) the Click event handler will be called 5 times and I will see the count to 1000 five times. Is it possible to disable other clicks on that button while the first click is counting? Note: Disab...

Firing an event / function on a property? (C#)

I am using a class that I cannot edit, it has a property (a boolean) of which it would be nice to be informed when it changes, I can't edit the properties get or set as I am importing the class from a .dll (which I don't have the code for). How do I create an event/function that is fired when the property is changed? Additional It is o...

how to "dock"/attach winforms forms

I'd like to attach two forms within the same app to each other like done by some of the music players such as winamp where the windows can be detached or attached together on one of the sides and after that moving one window movies the other one too ! There perhaps is a better term to describe this behavior any patterns or code samples...

Windows Forms ListView: SmallImageList - first column alignment

I am creating a Windows Forms ListView, and set its SmallImageList to place an icon in the first column of each row. I have set the TextAlignment for the column header to "center", but the icons are left aligned - can anyone offer advice on how to center align these icons? Thanks ...

Adding a visual behavior to multiple forms

I want to add a specific behavior to multiple forms. In this case its a balloon message that is triggered when a field fails input validation. The easiest solution I could come up with was making it a static class and calling it in the failure condition of each field's onvalidate event. public static class BalloonMessage { private s...

Spell Check window using MSWord interop opening in back of my application in Vista

I'm using MSWord interop to check grammar/spell in my application. I'm using these steps to do this: 1) Create a new Single Thread Apartment to not lock my application's form 2) Disable the input of my application 3) Using reflection (to be MSOffice version independent), I'm using this code to open Word: objWord = System.Activator.Cre...

What's the most efficient way to convert several win forms in VB2008 to a tabbed form?

I have developed an application inside ESRI ArcMAP that uses several forms that are raised by buttons on a toolbar. I'd like to convert these forms to a set of tabs on a single form. Is there a way to bind the forms to individual tabs or do I have to just recreate the form as controls on each tab? ...

If I have 2 listview controls on a form, which one handles the arrow keys? (WinForms)

I have a WinForm with 2 ListView controls. The first listview is on the left hand side and presents the list of categories, the second is on the right hand side, and presents items within a category. Think of it like the classic explorer-type UI, but specialized: the hierarchy is just one level deep. If I have a listviewItem highlight...

Drag-and-drop modifies read-only WinForm container (plus other peculiarities of drag-and-drop)

Sampling drag-and-drop between WinForm RichTextBoxes within one application and between them and external applications revealed two interesting observations (item 1 certainly appears to be a bug; in a perfect world, item 2 would probably be as well): Some drag-and-drop operations delete the dragged text from the source container, wheth...

How can I determine which version of Chrome is installed?

I'm working on a WinForms application. I'd like to know if chrome is installed and if so, what version is installed. It is simple enough to see if it is installed. But what is the best way to get the version number programmaticlly? For other browsers, I call FileVersionInfo.GetVersionInfo on the main executable. But google doesn't put t...

retaining value of a variable after application is closed and reopened

how do you save the value of a variable for later if the application is closed and reopened in winforms, vb.net? ...

defining specific custom colors that will appear in the colordialog?

is it possible in winforms, vb.net, to define the specific custom colors that will appear in the custom color boxes in colordialog? ...

record amount of time computer has been in use?

i would like to have program a timer that will count the seconds during which there is mouse movement or any keyboard movement. the point of this application is to record the amount of time an employee has been using the computer (does not matter what purpose or application it has been in use for) i would like to do this in vb.net for ...

colordialog size

is it possible to adjust the size of the colordialog prompt? is it possible to adjust the size of the sample color boxes within the colordialog prompt? these are both for vb.net in winforms ...

Enter Key Not Consumed by MessageBox, C#, Windows Forms

I have a form with a custom control on it. Assume the custom control has the focus. If I show a message box from that form, when the message box is closed by pressing Enter on either the OK or Cancel button, the message box is closed and then the custom control gets a keyboard event (OnKeyUp) with the enter key. This doesn't happen if...

C# combine 2 events in one method

I am relatively new to programming, as you will soon see... I have 2 events, which execute the same code. I currently have the following pseudo code for a datagridview: private void dgv_CellEnter(object sender, DataGridViewCellEventArgs e) { string abc = "abc"; } private void dgv_CellClick(object sender, DataGridViewCellEventArgs ...

.NET and Microsoft Excel

Hi, I have developed an application which imports data into Microsoft Excel. Am using VS2005 + .NET 2.0 and Microsoft Office 2007 is installed on my machine (Office 12). The compiled application works fine if I run it in my machine, but when I deploy the application to other machines say those using lower versions (Office 2000), I am g...

application settings not saving

unfortunately my settings do not get saved. please help If ColorDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Form1.BackColor = ColorDialog1.Color My.Settings.mytext = My.Settings.mytext & Str(Abs(ColorDialog1.Color.ToArgb)) & ", " End If onload i load the settings back into the textbox ...