winforms

BindingList<T>.Sort() to behave like a List<T>.Sort()

I am attempting to write a SortableBindingList that I can use for my application. I have found lots of discussion about how to implement basic sorting support so that the BindingList will sort when used in the context of a DataGridView or some other bound control including this post from StackOverflow: http://stackoverflow.com/questions...

selecting a item from a dictionary via a GUI

I have this situation: Dictionary<Int32, userInfo> users = new Dictionary<Int32, userInfo>(); Where the Int32 is the user id and userInfo contains the name and other details. I want to display a list of names at the form, and allow the person using the program to double click on one to open a window (similar to what happens in MSN mes...

How do I get a DoubleClick event in a .NET radio button?

I'd like to be able to catch the DoubleClick or MouseDoubleClick events from a standard winforms radio button, but they seem to be hidden and not working. At the moment I have code like this: public class RadioButtonWithDoubleClick : RadioButton { public RadioButtonWithDoubleClick() : base() { this.SetStyle( ControlStyles.Standard...

Dynamically changing the text of items in a Winforms ComboBox

(Sorry I have not been a able to write a very clear question) I have a Winforms ComboBox that contains instances of a custom class. When the items are first added to the Items collection of the ComboBox box, the ToString() method is call on each of them. However when the user changes the language the application is running in, the res...

.NET: How to get ActiveCaptionText color when window is maximized?

How do you get the ActiveCaptionText color when a window is maximized? The color is correct when the window is restored: But is the wrong color when the window is maximized: How do you get the active ActionCaptionText? Note: Same question for ActiveCaption, InactiveCaption and InactiveCaptionText. It seems like there should be...

Adding Multi-Select Functionality (Java Developer Learning C#)

I'm working on a piece of code that I inherited and am trying to expand it from only being able to select one row to being able to select multiple rows. Essentially, the item I'm working with displays like a data table. It contains methods for "OnSelectItem" and "OnMouseDown", with "OnMouseDown" checking to see if the click is right mou...

Integrated File Browser in .NET Winforms?

I'm looking to integrate a file browser that given a directory uses this as a root (can't go any deeper). I've used the System.Windows.Forms.WebBrowser control with some Button controls to support directory navigation (which disables when you hit the root). It works great except when the window is large it provides a properties bar on ...

Winforms - Replace a ConnectionString at runtime

Hi, I'd like to allow my user's to switch between different databases on the login page at runtime. I've currently got the ConnectionString stored in my App Settings file and all the dataset's refer to this setting. I have tried modifying this setting at runtime, but this seems impossible. How is the best way to do this? Thanks, ...

RichTexBox & FormFeed Characters

Hi, When loading a text file that contains FormFeed characters, the .NET RichTextBox control strips them out. Is there a way to keep this from happening? Thanks. --Lenard ...

Export DataTables into multiple Excel worksheets

I've got a load of DataTables that I want to export into several Excel worksheets (in a new spreadsheet / Excel file). The "solution" that already exists in the code I have is two nested for loops, iterating over all the rows and columns, inserting data cell-by-cell. This isn't ideal as the process takes well over 10 minutes. There's a f...

RichTextBox appearance

I am showing some text on RichTextBox in a winform. But I dont want the user to interact with it. Even after setting it Read Only, I can still see the cursor blinking inside it. If I disable it, the text gets faded which I dont want. Any idea how can I make it work or any work around. I am using RichTextbox because I need multilines and ...

Custom Winforms Controls (a button specifically)

I'm trying to create a custom button where the foreColor is always crimson and the backColor is always cyan. Ugly color scheme, but I'm just trying to get it so I can create large amounts of controls with a consistent color scheme without setting each control individually. Here's how I coded the button: public partial class CustomButton...

Flow Chart to model inspection process in .NET winform application

We're writing a .NET winform application and I'm looking for options on one of the features. The end user for this system will be defining inspection processes which need to be easy to follow and will be used to show inspectors their options when inspecting a product as well as to drive the inspection module on which questions need to b...

Right click menu under winforms

I want to make a right click menu for my winforms app. It will have the same two things in it no matter where it pops up. A little hunting and pecking leads me to the conclusion that winforsm either doesn't support this in a trivial way or has hidden it under some name I havn't guessed yet. I think I can make it work with the Click even ...

How to use Terminal Services Gateway with the IMsRdpClient6 ActiveX Control?

I am hosting the IMsRdpClient6 ActiveX control in my WinForms application in order to make connections to remote machines. I have setup a terminal services gateway machine, and I can successfully use it. I want to get my ActiveX control to use this gateway. I have set the Gateway options, but connection fails with no error that I can s...

How to implement Auto-Complete with a StandardValuesCollection on a PropertyGrid

I have a property on an object whose custom TypeConverter specifies an exclusive StandardValuesCollection (let's say "Foo" and "Bar"), so that when editing this property via a PropertyGrid, a drop-down list of these values is displayed. I would also like to be able to directly type in the field on the PropertyGrid, and have it auto-comp...

Example of a winforms app implemented as a wpf app?

I'm trying to learn more about WPF and I've read a bit about Model-View-ViewModel (MVVM) but if I were to create a WPF app I think I would still do things, out of habit, the same way I did in winforms. Which from my understand is going to eventually code me into a corner. So to one way for me to learn the 'right' way is to compare and ...

Does anybody write desktop apps using .NET?

I honsetly can't say that I have ever seen a commercial app that uses .NET (other then controls for devs/open source). With it being so easy to 'decompile' a .NET application using RedGates .NET Reflector, I was wondering if .NET was geared toward ASP.NET (since you can't 'decompile' because the code runs on a server and is not stored on...

Building a Email sending application in C#

I got the assignment to unify and simplyfy the companies Email sendouts from their site, with the possibility to edit the emails them selves. So Im scetching on a C# Window Form application with WYSIWYG-editor to manage all the emails. The email is stored in SQL-DB But im in dire need of some tips and pointers on the logic of some of th...

Issue with NotifyIcon not dissappearing on Winforms App

Hi there, I've got a .Net 3.5 C# Winforms app. It's got no GUI as such, just a NotifyIcon with a ContextMenu. I've tried to set the NotifyIcon to visible=false and dispose of it in the Application_Exit event, as follows: if (notifyIcon != null) { notifyIcon.Visible = false; notifyIcon.Dispose();...