winforms

How to draw delphi group boxes to have transparent backgrounds

I'm trying to get something very subtle to work, it looks pretty awful right now. I'm trying to paint the background of a TGroupBox which I have overloaded the paint function of so that the corners are show through to their parent object. I've got a bunch of nested group boxes that look very decent without XPThemes. Is there a way to ...

Panel.Dock Fill ignoring other Panel.Dock setting

If you create a panel on a form and set it to Dock=Top and drop another panel and set its Dock=Fill, it may fill the entire form, ignoring the first panel. Changing the tab order does nothing. ...

Is there an existing way to turn source code back into a CodeCompileUnit?

We use the DesignSurface and all that good IDesignerHost goodness in our own designer. The designed forms are then persisted in our own bespoke format and all that works great. WE also want to export the forms to a text-based format (which we've done as it isn't that difficult). However, we also want to import that text back into a docu...

Show a Form without stealing focus (in C#)

Hi, i'm using a Form to show notifications (it appears at the bottom right of the screen) but the problem that i'm having is that when I show this form it steals the main form focus. Is there a way to show this "notification" form without stealing focus? Thanks for your time. Cheers. ...

Reports in a .NET Winforms App

I'm writing a Winforms application and I've been writing these awful HTML reports where I have templates set up and use String.Replace to get my variables into the templates, then output the results to a WebBrowser control. I really don't like this set up. I'd love to be able to use ASP.NET for my reports, but my clients don't want t...

How can I easily turn a .Net Windows Form app into an Asp.net app using Visual Studio 2005?

I have a pretty basic windows form app in .Net. All the code is C#. I'd like to turn it into an Asp.net web app. How can I easily do this? I think there's an easy way since the controls I drag/drop onto the windows form designer are pretty much the same that I drag/drop onto the aspx design page. Note: the windows form app doesn't ...

What's the WPF equivalent of WinForms components?

Windows Forms allows you to develop Components, non-visual elements that can have a designer. Built-in components include the BackgroundWorker, Timer, and a lot of ADO .NET objects. It's a nice way to provide easy configuration of a complicated object, and it it enables designer-assisted data binding. I've been looking at WPF, and it ...

Windows Forms: A modal form that gets opened/closed by the application rather than the user?

I have what I believe to be a fairly well structured .NET 3.5 forms application (Unit Tests, Dependency Injection, SoC, the forms simply relay input and display output and don't do any logic, yadda yadda) I am just missing the winforms knowledge for how to get this bit to work. When a connection to the database is lost - a frequent occu...

Selecting Office 2003/2007 COM Object (Correct One) in Winforms Application

We are creating a Windows Form application (C# or VB.NET) that needs to reference an Office 2003 or Office 2007 COM object, depending on the version of office installed. What is the best way to handle this scenario and reference the correct COM object at runtime? ...

How to make a Windows Forms .NET application display as tray icon?

What needs to be done to have your .NET application show up in Window's system tray as icon? And how do you handle mousebutton clicks on said icon? ...

VB.Net Automating MS Word for Spell Check Capabilities

An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application. I currently have Office 2007 (which is the Office 12 com objects). My question is, if I add in the Office 12 objects what will happen on boxes which have Office 2003? This is in regards to ...

Synchronized ListViews in .Net

I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. So far I've been able to get the child ListViews to update their view when the master scrollbar buttons are clicked. The problem is that when clicking and dragging t...

How do I make a ListView row draggable in .NET?

I am not the most experienced GUI programmer, so bear with me here. I have a custom list view. I would like to be able to drag a row from the ListView to another control on a form. I know how to catch events that are fired when an object is dragged to a control, but I am not sure how to make a row itself draggable. I could always hac...

My form doesn't properly display when it is launched from another thread

Hello everybody! Here's the situation: I'm developing a simple application with the following structure: FormMain (startup point) FormNotification CompleFunctions Right? Well, in FormMain I have the following function: private void DoItInNewThread(ParameterizedThreadStart pParameterizedThreadStart, object pParameters, ThreadPriorit...

WinForms: color DataGridView border

How can I change the color of a DataGridView border when BorderStyle = FixedSingle? ...

Adjusting the auto-complete dropdown width on a textbox

I am using a textbox in a .NET 2 winforms app that is setup with a custom AutoCompleteSource. Is there anyway through code that I can increase the width of the list that appears containing the auto complete suggestions? Ideally I would like to do this without increasing the width of the textbox as I am short for space in the UI. ...

How to change ToolTip's position on a TreeView?

When using tooltips to show a detailed description of a TreeNode, the tooltip is drawn on top of the node, as if it was completing the node's text. Also, if the text is long, the tooltip is positioned in a way that the text exceeds the screen. But what I need is the tooltip to show right below the mouse pointer and not on top of the Tr...

Readonly ComboBox in WinForms

I'm writing a GUI in C#, Visual Studio 2008, using the Designer and WinForms. I've got a ComboBox control, and I'd like it to only allow to select from the provided options and not to accept a user-entered string. It doesn't appear to have a ReadOnly property, and disabling it hinders the readability of the control (as well as disallow...

Why do I get an error after closing my Winforms application?

When I run my vs.net winforms application by clicking F5 (debug mode), after I click on the close (which calls Application.Exit();), after a few seconds I get an error that says: cannot acess a disposed object: Object name 'SampleForm'. A bit of background, I have another thread that runs every x seconds. My guess is that when I c...

How do I grab events from sub-controls on a user-control in a WinForms App?

Is there any way for the main form to be able to intercept events firing on a subcontrol on a user control? I've got a custom user-control embedded in the main Form of my application. The control contains various subcontrols that manipulate data, which itself is displayed by other controls on the main form. What I'd like is if the mai...