winforms

winforms instrumentation . .

What is the best pattern for instrumentation. I have an application and i want to be able to track metrics on everytime a users does a number of functions in the app (brings up a form, views a certain feature, etc) but i dont want to have code all over the application that is doing this instrumentation. what are my options here? At th...

Winforms csv file generation, want to generate file then ask user to save it or open it

Hi, When a user clicks on a button on the winforms application, I will generate a CSV file. I then want to ask the user to either save the file to disk OR open the file. How can I do that? Note: I am just generating the file in memory, not writing it to disk until the user selects the path to save it to. ...

What resolution .ico files do XP and Vista show on the desktop?

There's loads of choices for .ico files but I can't see any logic in how Windows chooses which resolution/bit depth to show ...

How to save an stringbuilder's content to text file using SaveFileDialog?

This is a winforms application. In windows, I want the user to click and button, and then a popup should make the user select the path of where they want to save the file. ...

Generating a CSV file to be imported into Excel, what should I use for a newline character?

Hi, Creating a CSV file in a winforms application, it is to be improted into Excel. The file output looks like: "header1", "header2", "header3", 1,2,3, 4,5,6 What should I use to signify a newline character when generating the CSV file? ...

What would be the most convenient way to connect Visual Studio 2005 (C#) to Oracle8?

I'm looking for best practices for establishing connections between Oracle 8 and Visual Studio 2005 applications. The target would be a Windows Forms application written in C# that hits the database once a second to monitor tables looking for their last inserted record. I'm considering using "Application settings" to store the connection...

Autostart Smart Client application

Have a standard smart client application that we want to autostart when a user logs into their machine on our network. I've tried the following keys: HKLM\Software\Microsoft\Windows\CurrentVersion\Run HKCU\Software\Micrisoft\Windows\CurrentVersion\Run HKCU\Software\Micrisoft\Windows\CurrentVersion\Policy\Explorer\Run etc.... The star...

How do I find where my .Net app is leaking Windows handles?

Hi all, I've got a WinForms .Net app that runs over a lot of XPS documents (thousands) and during this run the number of handles (according sysinternals process monitor and task manager) increases by between 3-10 for each document. I heavily suspect that these are handles that are opened and not closed by the MS .Net XPS framework libra...

What is "DefInstance" and should I remove it from a WinForms app?

I am working on a VB.NET WinForms app that was "upgraded" by Visual Studio (originally 1.0 or 1.1) from VB6 code (which was itself upgraded from VB5). Except for the few new forms I've created since taking over maintenance of this app, all of the forms in the application have a method called DefInstance which allows you to grab an in-mem...

Confused about BackgroundWorker events not firing

This may seem like a somewhat contrived example, but I'm left scratching my head. Ok, I have a console app that instantiates a WindowsForm and calls a method called DoSomeWork() on the form. class Program { static void Main(string[] args) { Form1 form = new Form1(); form.DoSomeWork(); } } Form...

AOP for winforms . .

what is the best way to capture user clicks in my winform application with out making the code very complicated. is AOP the answer ? any good links or examples of this to track instrumentations . . ...

Winforms user control getting clipped when in another user control (sometimes)

The problem is fairly simple, but is best illustrated visually. Note that all screen shots are from the Visual Studio 2005 design surface. I've noticed no difference when I actually run the application. Here is my user control (let's call this UC-1): The buttons on the control are set to anchor to Bottom + Right. Here is what it l...

What's the neatest way to stop a Winforms window being moved around

We have a WinForms application which runs on a touch-screen on a bit of industrial equipment. For historical reasons which are not up for changing today, the displayed form has a normal Windows title bar. We would like to stop people using the mouse (i.e. touchscreen) from moving the window by dragging the title bar. We don't care i...

How do I enable a second monitor in C#

Is it possible to enable a second monitor and extend the Windows Desktop onto in C#. It needs to do the equivalent of turning on the checkbox in the image below? ...

Rich Diagram Controls in WinForms

I just started using ANTS 4 .NET profiler and I am looking for something similar to their Call Graph to implement in our own WinForms application(s). In essence, we are looking for a rich (animated) control that we could use to display the relationship between objects in our application - such as the hierarchal relationships between cust...

.NET VS2005 WinForms: How do i drop a user control onto a form?

i've written a UserControl descendant that is in an assembly dll. How do i drop the control on a form? namespace StackOverflowExample { public partial class MonthViewCalendar : UserControl { ... } } i've added a reference to the assembly under the References node in the Solution Explorer, but no new control has appeare...

Should path recursion occur in a class or presentation layer?

I have a WinForms app with an input textbox, button, and a multiline output textbox. A root path is entered in the textbox. Button click calls a function to recursively check all subdirectories for some proper directory naming validation check. The results are output into the multiline textbox. If the recursive work is done in a separ...

Why is the form_load event is not called in my Winforms application?

I don´t know why, but my form isn´t calling Form_Load event when it loads. Any ideas why this might be happening? ...

custom button captions in .net messagebox?

Is there an easy way to display a messagebox in VB.Net with custom button captions? I came across this, in the SO archives, but it's for managed C++ http://stackoverflow.com/questions/77293/what-is-an-easy-way-to-create-a-messagebox-with-custom-button-text-in-managed-c ...

Launching IE from winforms, can I close IE when my winforms closes?

Hi, I have a winforms application, that why someone clicks on a button I need to open up IE to a specific URL. When someone closes the winforms app, I then need to close IE. Is this possible? If yes, how? ...