winforms

Property Grid Object failing on combo box selection but OK when combobox scrolled or double clicked

I have a Property Grid in C#, loading up a 'PropertyAdapter' object (a basic wrapper around one of my objects displaying relevant properties with the appropriate tags) I have a TypeConverter on one of the properties (DataType, that returns an enumeration of possible values) as I want to limit the values available to the property grid to...

Transparent form on the desktop

Hi I want to create a c# application with multiple windows that are all transparent with some text on. The tricky part is making these forms sit on top of the desktop but under the desktop icons. Is this possible? ...

Simplest way to have a configuration file in a Windows Forms C# Application

I'm really new to .NET and I still didn't get the hang about how config files work. Every time I search on google about it I get results about web.config, but I'm writing a windows forms application. I figured out that I need to use the System.Configuration namespace but I'm kinda dumb and the documentation isn't helping. How do I def...

ReportViewer - LocalReport - Merge reports?

I'm using ReportViewer WinForms, and since it is no easy way to create an coversheet, then I wonder, is it possible to render two reports and have them concatenated?, so they appear as one report? If I was to print only, then I could execute two reports after each other, but since the user want to see the report before printing (you kno...

Editable data grid for C# WinForms

I need to present the user with a matrix of which one column is editable. What is the most appropriate control to use? I can't use a ListView because you can only edit the first column (the label) and that's no good to me. Is the DataGridView the way to go, or are there third party alternative components that do a better job? ...

How can I do Databinding in c#?

I have the following class public class Car { public Name {get; set;} } and I want to bind this programmatically to a text box. How do I do that? Shooting in the dark: ... Car car = new Car(); TextEdit editBox = new TextEdit(); editBox.DataBinding.Add("Name", car, "Car - Name"); ... I get the following error "Cannot bind to ...

Winforms for Mono on Mac, Linux and PC (Redux)

(I asked this question in another way, and got some interesting responses but I'm not too convinced.) Is Mono's GtkSharp truly cross-platform? It seems to be Gnome based... how can that work with PC and Mac? Can someone give me examples of a working Mac/PC/Linux app that is written with a single codebase in Microsoft .Net? ...

Horrible redraw performance of the DataGridView on one of my two screens.

I've actually solved this, but I'm posting it for posterity. I ran into a very odd issue with the DataGridView on my dual-monitor system. The issue manifests itself as an EXTREMELY slow repaint of the control (like 30 seconds for a full repaint), but only when it is on one of my screens. When on the other, the repaint speed is fine. I h...

Position the caret in a MaskedTextbox

I would like to be able to override the default behaviour for positioning the caret in a masked textbox. The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask. I know that you can hide the caret as mentioned in this post, is there something similar for positioning ...

Best practice to make a multi language application in C#/WinForms?

I've been looking into making applications suitable for multiple languages in C# since I need to work on a small project where this is the case. I have found basically two ways to do this: Set a form's Localizable property to true, set the Language property, fill all the labels and such, and you're 'done'. The major drawback I see in th...

Does WPF have equivalent controls for all Winforms controls?

Just found this out the hard way. I wanted to pop up a FontDialog to allow the user to choose a font.. one of those familiar dialogs.. ...

What should an Application Controller do?

I am a bit confused in what the application controller should do? Because I see the functionality will also exists in your MVP pattern to make the decisions which form should be shown when a button is clicked? Are there any good examples for Windows Forms that uses the application controller pattern? There is a difference in the MVC(on...

C# .NET 3.5 GUI design

Hello, I'm looking for some programming guides to C# GUI design. I come from the Java camp (where I can happily hand-code Swing/AWT GUIs) and thus don't have a clue where to start :( Also, what difference (if any) is there between the Windows Presentation Foundation and WinForms? ...

How to find GridItem from click on PropertyGrid?

I'm trying to do some custom UI behavior on a Windows Forms PropertyGrid control. I'd like to be able to respond to clicks and double-clicks on the GridItems to change the state. For example, to flip a binary or ternary variable through its states. I can get at the underlying view by looking up a child of typename "PropertyGridView" and...

How would you implement MVC in a WindowsForms application?

I don't develop too many desktop / Windows Forms applications, but it had occurred to me that there may be some benefit to using the MVC (Model View Controller) pattern for Windows Forms .NET development. Has anyone implemented MVC in Windows Forms? If so, do you have any tips on the design? ...

How can a modeless VB6 application do cleanup when the application is shutting down?

A VB6 application is using the Interop Forms Toolkit to work with forms written in .NET. The documentation for the toolkit advises calling a method on the toolkit to advise the toolkit when the VB6 application is shutting down. The VB6 application uses a Sub Main procedure that loads a splash screen, then displays several modeless forms...

What's the best way to implement clean UI functionality in WinForms while maintaining a decent decoupled architecture?

I tend to implement UI functionality using fairly self-documenting void doSomething() methods, i.e. if the user presses this button then perform this action then enable this list box, disable that button, etc. Is this the best approach? Is there a better pattern for general UI management i.e. how to control when controls are enabled/disa...

Reuse MVC arhitecture; Have two layers of UI : ASP.NET MVC and .NET Winforms

Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application? I defined the models, I defined controllers and views. They all work well. Now the boss comes ...

Windows Forms textbox that has line numbers?

I'm looking for a free winforms component for an application I'm writing. I basicly need a textbox that contains line numbers in a side column. Being able to tabulate data within it would be a major plus too. Does anyone know of a premade component that could do this? ...

winForms + DataGridView binding to a List<T>

So, every few months I write something in WinForms to remind myself why I hate it. Today is the day. I'm trying to bind a List<T> to a DataGridView control, and I'm not having any luck creating custom bindings (Ugh at all the late bound crap). I tried: gvProgramCode.DataBindings.Add(new Binding("Opcode",code,"Opcode")); It throws a...