winforms

how to send 2-3 param's to Winform C# program ?

hi how to send 2-3 param's to Winform C# program ? for example: i'll send something like MyProg.exe 10 20 "abc" and in my program i can receive those values (i dont want to show MyProg.exe - it will work background) thank's in advance ...

How to access other project forms in solution explorer for VS2008 C#?

Here is the image for my solution Explorer. What i want is to use HR Management forms to b loaded through button click on a form of Classic Steel HR. So can anyone tell me how ...

c# windows forms link button to listview

Hi, I am using c# windows forms. I have multiple buttons linked to a listview which when a button is pressed, a new item is added to the listview. The column headers in the listview are 'Name' and 'Amount'. When a different button is pressed, a different item is added to the listview. The thing i need help with is as follows: When the s...

Winforms panel event after scroll

Hello I have a panel in wich I do a bounch af rater complex drawing in the paint event. Since the drawing-code is kind of heavy, it gets rather twitchy when I scroll the panel, since the paint event is raised in such short intervals. My question is really this; Can i capture evnts such as "on scroll start" and "on scroll end" on a winf...

Custom context menu with 2 columns

is it possible to make two columns in context menu ? If so - how ? WinForms, .net 2.0 ...

Web developer moving to Winforms

I have been doing ASP.NET / C# development for several years now. I have recently been offered a project that will need to be a winforms application (I am assuming .net 2.0). Specs: Winforms applicaton Application will have "testing for understanding questions" Must support flash and camtasia files (these are "lessons") I have ...

Problem with deployment of windows application using setup wizard.

I have some xml files, which are used in my application. They are stored in the same folder with application , in subfolder DATA: "C:\MyProject\DATA\". To get the DATA folder path i use this code : static public string GetDataFolderPath() { string s = System.IO.Directory.GetCurrentDirectory().Replace(@"\bin\Debug", ""); ...

Using RichTextBox SelectionTabs property in winforms

In a winforms application, I'm using a RichTextBox and I'm trying to reduce the output from a '\t' to 4 spaces from whatever the default is. I have this in the form's OnLoad _richTextBox.Text = "1\t2\t3\t4\t5"; _richTextBox.SelectAll(); _richTextBox.SelectionTabs = new int[] {100,200,300,400 }; I have a breakpoint before and after...

What's the best way to tell if the mouse is over a form or not?

I figured out how to capture mouse clicks over the entire form, but this method doesn't translate well for MouseEnter and MouseLeave. My form layout is made up from many Panels and TableLayoutPanels so there's no all-encompassing control I can monitor events for, and obviously a MouseLeave event for a button doesn't mean the cursor left ...

Windows Forms: Unable to Click to Focus a MaskedTextBox in a Non TopLevel Form

Like the title says, I've got a Child form being shown with it's TopLevel property set to False and I am unable to click a MaskedTextBox control that it contains (in order to bring focus to it). I can bring focus to it by using TAB on the keyboard though. The child form contains other regular TextBox controls and these I can click to f...

C# - Drag item out of listview into a trash can?

How do I drag a item out of a Winforms-listview control onto another control (picture of trash can)? UPDATE1: I think the basic flow is: for the ItemDrag event on the listview have a DoDragDrop Then have a DragEnter event on the picturebox that captures that drag? UPDATE2: The basic flow (based on answers): add 'ItemDrag' event ...

WinForms: finding the size of a minimized form without going to FormWindowState.Normal

Is there an easy way to determine the size of a Form it does have in WindowState=Normal, without actually changing the Form state? Here is what I do now (C# code): public class MyForm: Form { public void MyMethod() { // ... FormWindowState oldState = this.WindowState; this.WindowState = FormWindo...

Drawing layers in GDI

Hello, I am creating an application in .NET using winforms. That application must draw on a Panel. Is it possible to paint objects on different layers, and combine that to one image on the panel? One layer has many objects on it. ...

how to call back to original form

I have 2 forms. Form1 and Form2. When Form2 is closing, how do I make Form2 to inform Form1 that Form2 is closed. Do I need to use Delegate, if yes, how? thanks. ...

Exception in the OnIdle event does not bubble up

On my main form, I subscribed to two events: Application.ThreadException and Application.Idle. In theory, any exception that is not caught should get bubbled up to the main form. However, this does not work if the exception happens in the OnIdle event. The system just crashes. Does anyone know how to solve this problem? Thanks so much. ...

Rule control to windows form (word style)

There are any control who can draw a rule regardless of the screen resolution? e.g. I wanna draw some text box 2 inches left and 3 inches down, and i wanna put the rules to guide the user. Or any idea to develop something like this? ...

Winforms MaskedTextBox - Reformatting pasted text to match mask

I have a MaskedTextBox control that, in our case, is collecting social insurance (tax) numbers (without a ValidatingType though since the string representation including the mask literals). A social insurance number is 3 groups of 3 digits separated by dashes. Sometimes spaces may be typed or entered instead of the dashes. The configura...

Visual C++ PropertyGrid Multi-dimensional arrays

I'm using Visual C++ 2008 and I'm trying to expose a multi-dimensional array in a property grid but I'm not getting the functionality I expect or want. property array<int,2>^ TestFixArr2D { array<int,2>^ get() { return testFixArr2D; } void set(array<int,2>^ value) { testFixArr2D = value; } } What I get is Int32[.] Ar...

Alternative way to notify the user of an error

I have a winform software that communicates with hardware through a protocol. Sometimes error in communication happens and i would like to notify the user. Errors could be for example: timeouts, crc errors, physical disconnection etc... I have a communication window in which i show these errors, but by default this is hidden. The use...

Efficient implementation of threads in the given scenario

I've got a winforms application that is set up in the following manner: 2 buttons, a textbox, an class object MX with a collection K as its member, function X and another function, Y. Function X parses a large database and enumerates some of its data in collection K. Button 1 calls function X. Function Y walks through the above collect...