winforms

IronPython + Winforms in a non blocking manner

I have been doing Michael Foord's IronPython&Winforms tutorials in the interactive console. Is it possible to remain in the console after the issueing Application.Run(form) so, I can put controls on the form while it is running? The goal is to dynamically modify the WinForms controls at runtime, adding event handlers, changing prop...

state management in winforms (c#)

Hi can I'm very new to windows forms. Here I want to maintain state (like session in web applications) in windows forms. Actually i want to store user login details in session. But i think there is no concept of session in winforms. So what is the alternative method to handle this type of situation. Regards, Nagu ...

dynamic radio button

I work on C# window vs05....For my application i need to create four radio button .....My form looks like: A(Radio Button) B(Radio Button) C(Radio Button) D(Radio Button) Submit (Button) When user click the submit button i need to know which radio button is checked.....hope i got the help? ...

checked list box text + value

Hi how to retrieve checked list box value in win forms application using c# ? just like in asp.net li.selectedvalue and li.selectedtext is there any methods like this to get value and text individually? Regards, Nagu ...

C# Bringing non modal form in front of modal form?

In our app we have a form that can be opened up non-modally. We have another form that can be opened up modally. From the modal form you can click a button to open up the non-modal form. This works fine, you can then mess about with both the modal and non-modal form. However, if the non-modal form was opened up before the modal one, th...

Child DataGridView inside a DataGridView

I have a data collection that holds a list of companies' data. Some companies have more than one office. I want to use windows form's datagridview to represent the data like this: |--Company Name--|--Company ID--|--Company Address--| | Alpha | 001 | 1 Alpha road | |--Office Name---|--Office Address--...

How to make a UserControl with a custom DefaultBackColor?

When I right-click on my custom UserControl's BackColor property in the property-grid, then click Reset, I would like the BackColor property to change to (for example) Color.LightGreen, and the property value to appear un-bolded, to indicate that it is the default value. Currently, I know I can do this: public override void ResetBackCo...

VB.Net apply XSL transformation to XML file

Hi there I have got some XML which is built by my application. This XML is dropped to an XML file, which I then wish to apply an XSL stylesheet to in order to convert it to a HTML page. However, every time, it just keeps coming out with the original XML rather than the transformed HTML Here is the XML: <firelist> <visitor> <Titl...

Custom Winforms Treeview - OnValidating not firing

I have a custom treeview that inherits from System.Windows.Forms.TreeView. I want to validate the nodes whenever the focus changes on the treeview. I've tried the following code, but the OnValidating event never fires. The CausesValidation property is set to true on the CustomTreeView on my form. public class CustomTreeView : Tree...

Multiple SQlCommand.ExecuteReader calls or do it once with datareader.NextResult()?

I'm using a SqlDataReader to populate an entity in a Winform app. The entity class has several foreign key attributes in the database that I want to setup as properties in the entity class. Each property will be of type 'Attribute' with an ID & Description property. Some of the users of the system are far from the database, so data acc...

C# - Can I Data Bind between a value and an expression?

Hi, I have a List and a Button. When the Lists Count == 0, I would like the button Visibility to = false. How do I do this using Data Binding? Thanks in advance, Added I have asked this so that I can try to avoid checking the Count on the list in code every time I add or remove an item to or from the list. But if there is no solution...

Oscilloscope UserControl for .net

I'm looking for a way to paint real time measurement data as a curve in a WinForms app. Here is an example of something quite close to what I'm looking for. But is there something more modular out there? ...

ListView moving items

Hi, I have another problem with ListView :( Now I need to move items in group (up, down, to the beginning, to the end), but ListView is displaying moved items always at the end. Here is sample code for moving item to the beginning: if (1 == listView1.SelectedItems.Count) { ListViewItem item = listView1.SelectedItems[0]...

DataGridView AutoGenerateColumns is set to true somehow

Hello, I derive DataGridViewEx class from DataGridView like this: public class DataGridViewEx : DataGridView { // ... [DefaultValue(false)] [Browsable(true)] public new bool AutoGenerateColumns { get { return base.AutoGenerateColumns; } set { base.AutoGenerateColumns = value; } } public DataGridViewEx() { AutoGenerateCo...

Why can't I use LINQ on ListView.SelectedItems?

I am trying to do use .Select extension method on ListView.SelectedItems which is SelectedListViewItemCollection, but .Select doesn't show up in intellisense. I can use foreach on SelectedListViewItemCollection, so it must have implemented IEnumerable. I just checked on MSDN, and it certainly does. Then why can't the LINQ extension meth...

Can't fire MouseWheel event in C# Windows Forms.

First off, the mousewheel event is not listed in Visual Studio 2008's events pane which is very annoying. I found the correct format online though, and wrote this into my code: private void Form1_MouseWheel(object sender, MouseEventArgs e) { Debug.WriteLine("Foo"); } ...from which I'm getting no response when the ...

How to dock a control inside a panel at runtime on windows forms?

I am designing a simple user interface using winforms. In the designer I have a panel on the form and would like to add a datagridview control into the panel at runtime and set the dock property of the datagridview to 'Fill' so that it fills the panel. I am struggling to do this and following code is not working out for me: Dim MyDataG...

What could cause a long delay after reading events from WMI using Vb.Net

I have a windows user control that reads events from the application log of a remote server. I can read in the information alright, and it appears to happen very quickly, however the thread hangs up for about 30 seconds afterwards and keeps my application from displaying the log. I am afraid that this is probably caused by my lack of e...

how do i edit "unknown publisher" in my app?

i guess my .NET application needs to be signed or something. how do i get rid of that prompt unknown publisher when someone tries to install my app? ...

Where are examples of great program UI's built free with Winforms?

I'm trying to decide between Winforms and WPF for a C# application. I want a good free UI and I know WPF would make a great one. But how good can a free UI look built on Winforms? I've read that Paint.net was built on Winforms, but I don't think the UI is very attractive. I'm looking for the freshest looking free UI's that can be b...