winforms

why would a re-thrown exception in a button click not get back to the user?

I have this code: 001 private void uiButton1_Click(object sender, EventArgs e) 002 { 003 string someString = ""; 004 try 005 { 006 someString = ThisMethodThrowsAnException(); 007 } 008 catch (Exception) 009 { 010 throw; 011 } 012 } The code does get to the "throw" in the catch but t...

MSChart - Auto Zoom Y Axis on X Axis Zoom

I'm using MSChart and I want to enable zoom on the X Axis and once this is zoomed I want the Y Axis to auto zoom into a range appropriate for the data viewable. Any assistance with the problem would be greatly appreciated! Thanks ...

How to receive the Windows messages without a windows form

I am trying to write a class library that can catch the windows messages to notify me if a device has been attached or removed. Normally, in a windows forms app I would just override the WndProc method but there is not WndProc method in this case. Is there another way I can get the messages? ...

.NET Resize Event: Get old size?

I've added a resize event to one of my widgets, which looks like this: void glControl_Resize(object sender, EventArgs e) { Is there a way I can get the old size of the widget (before resizing)? Maybe I can cast e to something that will give me more info? Or should I just save it during that event? ...

Need an alternative to ProgressBar control for player resource pools (Health, etc.) in a game

I'm trying to implement a basic Health/Stamina/Mana readout in a Windows Forms application, and my first approach was to use a ProgressBar control. However, I'm not fond of its visual representation in Aero (always green and too much distracting gloss animation), and I'm not quite ready to get into WPF development (which is, from what I ...

Dev Express RibbonControl Image Size

Is there any way to change the size of the image in a ribbon control. It is autosizing my images smaller than I would prefer, is this changeable? ...

Update datagrid view with updated data

Hello, I've a datagridview. I read an xml file and bind the data to the gridview. I change the xml and save it in another form. So i reread the xml file and i bind it to the gridview. The datatable is getting the updated values. But the grid is not getting updated till i close and open the application again. How to do it? Thank you. R...

.NET Redraw at 60 FPS?

I've got some animations running in an OpenGL context window, so I need to constantly redraw it. So I came up with the following code: void InitializeRedrawTimer() { var timer = new Timer(); timer.Interval = 1000 / 60; timer.Tick += new EventHandler(timer_Tick); timer.Start(); } void time...

C# Winforms, MVP architecture

Hey peeps :-) (...sorry this is a bit long) I'm developing an application using C# Winforms and an MVP pattern, it's only a relatively simple app - although it is doing a fair amount of stuff, so I consider the MVP pattern to be a big help in organising the code. I've created an instance of the Models to be used - a STATIC instance - ...

How to set which control has focus on Application start

In C#/Winforms how do I set the default focus when my application starts? ...

Merge cells in datagridview

Is there a way to merge cells in datagridview of .net in winforms .I would like to merge two or more cells of a row . ...

Controlling user workflow in Winforms

I'm building a Winforms application in C# and I have added a tab control that has three tabs. I want to restrict user's ability to access the second tab page until user fills out the first tab. I have a submit button the first tab, I want the second tab to be able to be accessed when the user clicks on the submit button. How can I ac...

Image GDI+ Error c#

First sorry for the english. I'm having an strange problem when I'm trying to save a bitmap ("Generic GDI+ error") from a picturebox in my win app, I know that this problem occurs when trying to save to a directory that has no permission, but in this case I'm trying to save it to a memoryStream. using (MemoryStream fotoStream = new Memo...

How can I dynamically move/resize a form?

I am doing an alert system that will show messages 'a la' Messenger, and I want them to move or resize to make them appear. How can I do this without having to do this: do { this.prop += 1; } while (this. prop = destination); ...

filled rubber band in Winforms Application

how can i draw a zero opacity rubber band over a windows form with 0.3 opacity? (The rubber band is made after a Microsoft example Update: I need that rubber band to work something like a mask. If you use Jing or any other screen shot tool, you will see EXACTLY what I need to do when do you try to make a screenshot: the screen goes ...

Convert Windows Forms into an MMC SnapIn

I have a Windows Forms app, which I want to convert into an MMC snapin and display the form in one of the forms, the form has a few buttons and event handlers for button clicks etc. Should I convert the winform into a user control, will my event handlers still work in this case? Whats the best way to do this? ...

What can cause Application.Run() to stop blocking?

My winforms application does something like the following: * Please note, the code below works as expected and blocks on singleInstance.Run(new string[0]{}); I haven't been able to reproduce the problem outside of my application static class Program { /// <summary> /// The main entry point for the application. /// </summar...

.NET Connection to dBase .dbf file

I'm trying to read a dBase III .dbf file using .NET and Winforms and nothing I've tried seem to work. I tried four different connection methods and every one of them hangs on Open method. No exceptions, no timeouts, no event messages, nothing. The form just sits there. Any ideas about what could be wrong? Here's the methods I've tried....

WPF: The correct way to make a standard menu

I've just started out fiddling with WPF in Expression Blend and now I'm trying to design a "normal Windows GUI" interface with a menu at the very top and some other stuff which takes up the rest of the window. Which panel do I use to make the menu always stay at the very top, take up only as much height as it needs to fit the menu items...

How to update the layout whenever a control changes height in Winforms?

I have a custom LayoutEngine and it handles the layout correctly. However I want the layout to update (be called again) if any control changes height. Is this possible? If so how and where should I do this? Inside the control, or the layout engine? Preferably I wouldn't want this code to be duplicated wherever I have this layout used. ...