winforms

CheckBox Tags & Codes

In TreeView you can add a tag to the node. In a checkbox ... you can't. I found TreeViews useful because this allowed me to use the name for the "display" value and the text for additional information. Example the name as "Google" and the tag as "http://google.com". How is it possible to do this with checkboxes? I know a checkbox accept...

New Thread required on FormClosing?

I have a button click event handler which says this.Close() In the FormClosing event I detect unsaved changes and say "Do you want to Save?" If they say Yes I set e.Cancel = true and then call my Save method. If the data is saved ok in my Save method at the end I say this.Close() but the form stays open. This seems such a simple idea...

DevExpress LookUpEdit Behavior....

I'm tearing my hair off for this amazing problem. I'm binding 2 LookUpEdit from code: MyBinding.DataSource = typeof(MyObject); MyBinding.DataSource = _dataObject.GetMyList(); firstLookUp.DataBindings.Add("EditValue", MyBinding, "Code"); firstLookUp.Properties.DataSource = MyBinding; firstLoo...

how to get dependencies injected in constructors in Windows Forms

in asp.net-mvc I have the Windsor Controller Factory that injects all the dependencies into the controllers, but how do you get this in Windows Forms ? for example if have this Form1, how am I going to get an instance of Form1, should I use resolve (which is called ServiceLocator and anti-pattern by some ppl)? public class Form1 { ...

is there something similar to asp.net mvc for winforms or wpf ?

anybody knows something similar to asp.net mvc for winforms or wpf ? ...

In winforms what is the best (or a good) way to bind a form (view) to a strongly-typed object?

For example if I have a Name object public class Name { public string First { get; set; } public string Middle { get; set; } public string Last { get; set; } } and I have a form with 3 textboxes on it, named txtFirstName, txtMiddleName, txtLastName I want some way to automatically bind the domain object to these text boxe...

Snap-To lines when aligning controls at Runtime

Hi All I have an app where users can drag controls around on a Form. But they re asking me for Snap-To lines to make the alignment of controls easier. I have no idea about the snep-to lines and how to implement them - I have looked at: http://msdn.microsoft.com/en-us/library/ms752100.aspx Adorner's, but it says it's only for WPF. And I...

performance in C# Application

Hi all i use some pictures in my 'MainForm' And My Windows Application was writing by c sharp. i use this form to start other forms in my project. And I use some label and panel with Transparent Color. but when the program started i see many blink in transparent label and panel. And it is very bad. How I Can Fix this problem? ...

How to make nested child forms in C#.net

In my windows form application I am using 10 forms.It is fine when only a parent and single child form are used at a time. But in case of multiple use of child form I am getting problem and not able to use them as child forms.They are not working as child form. Your any effort would be helpful for me. Th...

Erratic behavior from ContextMenuStrip

I am getting some erratic behavior from a ContextMenuStip: private void lstModules_MouseMove(object sender , MouseEventArgs e) { mouse = e.Location; } private void lstModules_MouseDown(object sender , MouseEventArgs e) { ListViewItem item = null; if((hitTest = lstModules.HitTest(mouse)) != null) item = hitTest.Item; switch...

Remove(), Clear() or Dispose()

Hi All Simple question... I have controls that the user can drag around on my form at runtime. And they can also delete them... Should I just Call .Dispose(); when they click the delete button, or should I do something like panel1.Controls.Clear(Control); ? ...Or something else? Thanks :) Bael ...

C# : Blocking a function call until condition met.

I am developing a C# Winforms application, part of the application will be uploading files to a webserver using AsyncUpload (using it,due to the need to use a porgress callback) , In the C# program i got a simple for loop that calls The Uploading function for(int i=0;i < 10 ; i++) { Uploadfun(); } And the fun does some magic: Up...

LINQ to SQL not worked in Window application

Hi Friends, I have created LINQ to SQL Class and trying to insert one record in application but unable to save record in database table in window application Table Name : Test I have two column in table 1) TID Type INT , Primary Key , Identity column 2) Title Type Varchar(50) I have written below code to save new record in to tabl...

Resetting a key in My.Setting

I know it's possible to reset the My.Settings with Reset() method. Is there anyway to do the same thing for just one setting? Or simple getting its default value instead of the one changed by user. (I'm referring to User Scope Settings) ...

Read xml string into textbox with newline

I have a class with a member "Address" that I read from an XML file that has the following format(fake address - The XML field name is "Address" - not shown): 106-1190 Crescent St. \r\n Toronto Ont \r\n V2K 2Z6 I have created a Multi-Line Textbox to display in a form with the Accepts-Return property set to true. The Textbox displays t...

Making child control an IContainer

I've created a control class that inherits a Panel control. This control then contains two other panels, one of which I would like to be an IContainerControl. I know how to turn the entire control into a IContainerControl but have been unable to do the same to a child control. I've tried in both C# and VB.Net and failed with both. Do...

OnPaint override is never called.

I have been at this for a few days and it is driving me mad. I have a control that inherits from System.Windows.Forms.Panel and I'm trying to override OnPaint. It just plain, outright IGNORES it. public class CollapsiblePanel : System.Windows.Forms.Panel { public CollapsiblePanel() { // // Required for the Windows Form Designe...

Is S#arp applicable in classic ASP.NET or even WinForms?

I know S#arp architecture is built for ASP.NET MVC. But I'm wondering if it can be used in classic ASP.NET (WebForms) or even desktop applications like WinForms or WPF. Thnkas a lot. ...

Add Inherited Controls to a Panel

I have a base form with two buttons (e.g. OK and Cancel). I want to use a TableLayoutPanel and have the two buttons in it. Child forms should be able to add more controls to the table as well as modify its layout itself via the designer. So far I can't get this to work. I have tried the following: Adding the TableLayoutPanel to the ch...

Downloading updates from web address. C#

Ok, so I have an app that checks for updates at http://mysite.ext/sub/sub2/sub3/appname/ and after the very first publish (a few days ago) it was checking for/downloading updates from that url correctly with no problems. But today, I published a new version, only minor changes to the ui (changing button text etc), then uploaded latest...