winforms

User Control on Panel remains visible when visible set to false.

I am trying to swap out user controls dynamically. How can I 'hide' controls on a panel? Removing them from the Controls collection does not work and setting the control's visible property does not work. ServersView servers = new ServersView(); ServersPresenter presenter = new ServersPresenter(servers); _view.Se...

c# : Inheritance of the form By procedure

How is Inheritance of the form By procedure ? ...

Add Event at runtime

my method is : private void button1_Click(object sender, EventArgs e) { for (int i = 1; i < 10; i++) { Button btn = new Button(); btn.Name = "btn" + i.ToString(); btn.Text = "btn" + i.ToString(); btn.Click += new EventHandler(this.btn_Click); this.flowLayout...

Converting string formula to mathematical formula in c#

Hai all, I am doing c#.NET application to calculate different formulas and give result to user,users can enter any formula and each formula values are stored in database like this. After saving like this i want to calculate the result.When calculating the result,application ask values for variables.But how can i calculate with this ...

Transferring data bettween forms using text boxes and list boxes

Hey guys, I am having trouble effectively transferring data between forms. So I have my entry form. It has one button: private void addBtn_Click(object sender, EventArgs e) { string data = string.Format("{0} \t {1} \t {2} \t {3} \t {4} \t {5}", fnameTxtBox.Text, lnameTxtBox.Text, ce...

C# - Listview colum header height (Windows Form)

Hi How can I change the height of the column header in a ListView ? (visual studio-2008,windows forms) ...

CKEditor - client side spell checker

CKEditor supports by default server side spell checker. There is any solution to integrate a client-side spell checker? P.S. I'm using CKEditor in a WinForms application. ...

Setting DropDown list width of DataGridView ComboBoxColumn - WinForms

I'm having a datagridview with combobox column in it. This column is databound. I want to set the width of the dropdown list as per the largest item width in the list. For a normal combobox to achieve the same I've used a extension method which will set the width of the combo box by finding the largest width item in the list. This is don...

WPF inside WinForms, why is a Child instance created?

Hello, Question: I have a WPF control hosted in a WinForms application with the use of the ElementHost. I’m hosting the WPF DatePicker control. Everything works great, except when I resize any control in design mode a Child instance is created by the “designer generated code” in the InitializeComponent method. Child = new MyControls....

Is it possible to have Label.Image appear inside the padding region?

I'd like to be able to have a Label such that it appears something like [Some bit of text here] [ICON] i.e. the icon follows the text, fairly straightforward. I don't know what the text will be at design time, so I have AutoSize set to true on the Label control, but this means the image just gets drawn on top of the text. If I add Pad...

TableLayout columns do not Resize

I have a tableLayout with Three Columns. Column 1 : A ListBox that is Dock->Fill Column 2: a Button Column 3: Another ListBox that is also Dock->Fill For the resizing I have set all the columns to "AutoFit" But when I resize the form, it only resizes the ListBox that I have in Column3 and it does Not resize the listBox in Column 1...so ...

How to override UserControl class to draw a custom border?

I would like to override System.Windows.Forms.UserControl to draw a custom border (e.g. using custom color). It's not possiblу to do usign built-in classes, because the only method/property you can affect the border behavior is BorderStyle. Overriding OnPaint the following way (code below) is not a good solution, because it's basically ...

Validating numeric formats in Win Forms

I have a number of text boxes on a win forms control that need their input validating. How do I validate for a number in the following format nn.nn also, how do I validate that a number is a positive integer thanks ...

Simplest way of having forms "group" together?

As in: when one form is activated, they are all activated, when one form is minimized they are all minimised and so forth. ...

Calling an asynchronous method serially

I have the following (simplified) asynchronous method: void Transform<X,Y>(X x, Action<Y> resultCallback) {...} and what I want to do is transform a list of Xs into a list of Ys. The problem is that even though the Transform method is asynchronous, it has to be called serially (i.e. I have to wait for the callback before calling it w...

c# winform email progress and cancellation

Any ideas on to implementing a progress bar type solution for heavy emails? So when heavy attachments are being uploaded a progress bar with actual % or bytes uploaded can be displayed? Searched on this topic a bit, a third party library here supports this kind of thing. But looking for some piece of actual code or material on how to i...

Why Microsoft Windows Phone 7 Team didn't use the same semantics of ActiveControl for Winform ?

On Windows Phone 7 to get the current control one would use FocusManager.GetFocusedElement() Wherea on Winform it is just ActiveControl. Why use 2 semantics which is a nuisance for portability ? Is there any difference of behavior you can see between the two ? If yes that makes sense, otherwise that doesn't. ...

value of datagridview on textbox

i have a datagridview and a text box, when i click on a cell of datagridview, the value must copy on the text box, but this not always work olny works sometimes please some help thnk. private void gvProductos_CellContentClick(object sender, DataGridViewCellEventArgs e) { //DataGridViewRow row = new DataGridViewRow()...

Weird Windows Designer Loading Exception

My designer is failing to load my form because of some weird issue. I have a BaseForm, from which all forms are inherited. This base form also implements an interface, ViewInterface (I am implementing MVP pattern). Now if ChildForm inherits the BaseForm, the designer fails to load ChildForm. It gives the error 'failed to load type Nam...

from datatable to array، no loop

Following Code for transmission to the list box is : DataTable dt = new DataTable(); DataColumn dc = new DataColumn("BestSite", typeof(string)); dt.Columns.Add(dc); for (int i = 1; i <= 10; i++) { DataRow dr = dt.NewRow(); dr[0] = i.ToString() + " = stackoverflow"; ...