winforms

How do I make a DataGridView that doesn't snap its rows to the top of the control?

We've used the DataGridView extensively in our client. Our customers want to be able to enter large amounts of text into a row - too much to be displayed in the height of the DataGridView - and scroll through them using the main scrollbar - i.e. the DataGridView's scrollbar. However, the DataGridView will only scroll such that a row is...

Winforms MenuStrip Underlined Hotkey Letter

Typically the hotkey letters on a MenuStrip are underlined. (&File, &Open, etc) On a project I'm working on the underline shows up in the designer, but not at run time. I can't find the property that controls this. Anyone out there know? ...

C# WinForms - How Do i Retrieve Data From A Textbox On One Form Via Another Form?

Hello, I have a method that executes inside one form, but I need to retrieve data from another form to pass into the method. Whats the best way of doing this? ...

Best Practices for asynchronous calls in MVP with WinForms

I am using the Model-View-Presenter pattern in a WinForms project and one problem (among many) that I am having is when the form tells the presenter to do something and then is un-reactive while the presenter goes of to do it. Fortunately in my project I have no problem with making all presenter calls asynchronous the question is how ex...

TableLayoutPanel Controls - Lock Column from Horizontal Scroll?

I'm using a TableLayoutPanel in a Windows Forms application to organize a set of controls in a grid-like fashion. I'd like to lock the TableLayoutPanel's first controls column so that it remains fixed when the user applies the horizontal scrollbar. Any guidance is appreciated. ...

Expose a collection of enums (flags) in Visual Studio designer

I've got an enum of types of data that might be shown in a .NET Forms control and I want to provide an interface for consumers of the control to filter some of the types (set some of the flags). A bit field seems the logical way to do this, unfortunately, the enum starts at 0 rather than 1 (0, 1, 2, 4, 8, ...) and can't be changed. How...

How do you write to the Log tab and Console.Error tab of the NUnit gui runner

In the NUnit Gui Runner, there are 6 tabs. I can write to the Console.Out by writing something like: Console.WriteLine("This will end up in the Console.Out"); I can write to the Trace tab by writing something like: System.Diagnostics.Trace.WriteLine("This will end up on the Trace tab"); But how do I write to the two other tabs, "...

What is each tab in the NUnit Gui Runner supposed to be for?

There are six tabs in the NUnit Test runner: Errors and Failures Tests Not Run Console.Out Console.Error Trace Log I know what Errors and Failures are for but the purpose of the remaining tabs is confusing. Both Console.Out and Trace appear to serve a similar purpose. As a comment has pointed out, I have written a similar question...

Handling Events for late-bound objects

I would like to use MS Office automation and have event handlers that fire for user-triggered events. For example, if the user clicks the save button in Word, I want to intercept that event and execute code in my program. I don't want to be bound to a specific version of Word because I don't know what version my user will be running, so...

How do I find the visible part of a control?

I have a control whose parent is a ScrollableControl. How do I find the part of the control that's actually visible to the user? Both are rectangular - there's no funny business with Regions. ...

What could be causing design view to be so slow?

With small projects, I can switch to design view almost instantly (< 1 sec). I have a large project that takes about 60 seconds to open a control or form in design view - for the first time only. After this 60 second delay, I can open any control in the project in design view almost instantly - until I recompile the project. If the ex...

Show listbox outside of form (winforms)

Is it any possible to get my listbox to be shown outside of the form's bounds? One of the solutions is to make the form itself transparent, and add the panel instead of the form for the background. But is there any other, more delightful way to do that? UPD: i need to make a custom autocomplete for textbox, to support wildcards. so i ...

Scroll Event in C#

Hello all, Let's say I have a DataGridView Control that displays about 100 records of a specified table. Every time a user scrolls down to the lowest point, I want to add another 100 records to the DataSet that stands behind my DataGridView. I knwo that a DataGridView Control has a Scroll Event like private void DataGridView_Scroll(ob...

Clickonce ask for a License agreement

Is it possible to build a ClickOnce deployment, for a Win Form application, to ask for the user to agree to a License Agreement before continuing? ...

Animated gif on button stops after moving (redrawing) the form.

Hi, I have an animated gif placed on the button. It's animating ok (most of the times :P) but when the windows is redrawn (repainted) the animation stops. I have tried to refresh the button (button.Refresh() ) while handling Paint event but it didn't solve the issue. \ Anyone knows how to fix this? ...

How can I databind dynamically loaded DataGridViews?

I'm developing a Windows Forms application in VS2008. I want to display a unknown, but small number of DataGridViews on a form, using code like this: foreach (QueryFilter f in Query.Filter) { DataGridView grid = CreateGridView(String.Format("GridView{0}", filters.Count)); grid.Location = new System.Drawing.Po...

Antialiased SmoothingMode distorts Dashed Pen

Why does switching on anti-aliasing interfere with my dashed pen? ...

Pros and Cons of the available Visual Studio 2008 c++ project platforms?

If choosing between: ATL Windows Forms MFC Win32 Specifically the application will be: for completely in-house use. Most users lack basic windows/pc knowledge. (consider simple UI) used for automated testing which entails:-bringing in lots of data from external equipment (can choose VXI, USB, or Ethernet)-very heavy on graphics - l...

Single click to open menu for tray icon in C#

How do i force a context menu for a tray icon to be shown when it is click rather than just right-clicked. Ive tried using the MouseClick event, but the eventargs have the mouse position at x0y0. ...

Winform memory spike

Hi, I have the following issue. I have deployed a smart client application to several users. Memory usage is adequate for all of them except one. For this particular user the memory usage is 2 to 2 1/2 times the usage than for any other user. The desktop specs are the same as for the other users. The computer was defragged not long ago. ...