winforms

C# WinForms position a form relative to another form

In my application I have a mainform. When the open button is clicked I want to show a second (borderless) form whith the text loading. I've got this working so far. But what I want is that the loading form is centered relative to the mainform. How do I do this? SOLUTION: private void tsbOpen_Click(object sender, EventArgs e) { if...

Concerned with selectedindexchanged of dropdownlist

hi guys, I have a combobox in which iam loading combobox using following code. public void LoadCustomer1(ComboBox pCmbCustomer) { obj._dtInputParameter.Clear(); obj.AddInputParameter("@Prm_OpFlag", "S", "String", 1); //obj.strSPName = "prc_CUST_Details"; obj.strSPName = "Edi...

Winforms Open Last Closed Form.

Hello there.. How do i Re-Open Previously Closed Form. Like I have Form 1 and Form 2 and Form 3 Previously I have opened Form 1 and 2 and Closed them then How do i track that previously i have Closed Form 1 and Form 2 anyone who face similar issue and have the solution please Help.... ...

Control that is bigger than the form region is getting clipped in C#

Hi, I have a normal Form control and in the CTOR function I have the following : this.Region = System.Drawing.Region.FromHrgn(WinUser.CreateRoundRectRgn(0, 0, this.Width, this.Height, 16, 16)); Later in my App I create a ListBox object and show it at the bottom of my parent form, but the listbox size is bigger than my form and theref...

How to change the background color of a rich text box when it is disabled?

Whenever I set the RichTextBox.Enabled property to false, its background color is automatically set to gray as it is set to the color in system color which is set in the control panel. How can I change its color to black even if I set it to disabled? ...

is it possible to dynamically resize the lable in c# without changing the length of text?

i am unable to change the size of the lable in windows form application daynamically. ...

Should I inherit or subscribe to events?

If I create a Abstract BaseForm for my Windows application, I can use it to do common things when the application's forms are loaded. I can also override the OnLoad method, or I subscribe to the Load event (BaseForm_Load). Which approach is better from the design and performance point of view? ...

How to handle Form caption right click

I'd like a context menu on the caption bar right click any tips/samples pref in c# ? UPDATE - for various reasons, right click on the form won't work because the form is not empty and the form is composited dynamically so.... ...

How to modify windows forms width in Visual studio 2008 using script or command ?

I add two buttons in personalized Control ToolBar, this ToolBar is used in several VB.NET windows forms and some toolbar buttons does not show correctly, the right side buttons are hidden and are very important to show all of them. How I get to modify this windows forms width using a script or VS 2008 IDE macro ? ...

Help Button on Winforms

Possible Duplicate: How to include help ? in title bar of winform Is there a way to have the four Buttons at the same time. I'm trying to do it but whether I show the Maximize, Minimize and Close button or the Help and the Close Button, but I can have the four of them in the same Form ...

[C#] How to make Background thread pause and then continue on button click?

I have a Windows Form and a class with two simple methods that run recursively in a nondeterministic way (meaning that it's unknown which recursion will be called, both can call the other)... Now, there are some points during that recursion at which I want to pause the execution and wait for a user to click on the "Next Step" button. Onl...

Latitude and Longitude validation in windows application

Hi all, i am searching for latitude and and longitude validation. can any one suggest that validation. i am using if (Regex.IsMatch(textBox1.Text, "\b(?(?:90|(?:[0-8]?\\d))([ -/])[0-5]?\\d\\1[0-5]?\\d(\\.\\d{1,4})?\\1[NS])\b") == true) Thanks to all. ...

Something swallowing up unhandled exceptions?

In an application I'm making, sometimes exceptions that are thrown but unhandled, seem to disappear into thin air and cause strange bugs with the GUI. I'll usually find it by stepping through until reaching the line where the exception is thrown, at which point Visual Studio immediately stops stepping and returns to the application. It...

The Event for Middle Mouse Down And Move

What is the control event for middle mouse down and move? That is, what is the event that I can subscribed to when I hold my middle mouse down and move the mouse? ...

How to access winforms data from wpf interop?

There are 2 projects in my Solution. -WindowsFormsApplication8 -WpfControlLibrary1 I am using ElementHost from WPF Interoperability to host UserControl1 from the WpfControlLibrary1. _________________________ Form1 - [] x | ------------------------- .......... | label1 | // label .......... // elementHost1 // wpf...

Invoking non static method from static method

Can I call(access) non static method from static method ?? Like I have static method If yes, how?? public static void method() //like this is a static method { methodsec(); //from here I want to access non static method defined below } public void methodsec() // non static method { } ...

making btn_Click event static

There is a private void btnContBalloon_Click(object sender, EventArgs e). Can I make this static because I want to invoke this from static method but I can not. ...

Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) - possible?

I have a simple Windows Forms (C#, .NET 2.0) application, built with Visual Studio 2008. I would like to support multiple UI languages, and using the "Localizable" property of the form, and culture-specific .resx files, the localization aspect works seamlessly and easily. Visual Studio automatically compiles the culture-specific resx fi...

Debug through the disassembled code (with Visual Studio)

Hello. There is a lot of disassemblers witch allows seeing the internal structure of .NET base assemblies. Is there a way, add-in or similar for Visual Studio that will permit debugging through the disassembled code? By example I have a user control I set the Width = 100 but the width always remains to 200. After a half on hour I rem...

C# Hide new Form at start

hi, Ihave a form which is hidden and this loads a subform the 2e form should be hidden aswell Please notes: I most not use ShowInTaskbar = false; // should be hidden too and I most be able to communicate between forms if I use (hide/visible) i cant communicate until its visible = true; this.SetParameterValueCallback += new SetPa...