winforms

Visual Studio - Quick way to search for an object's usage in the code behind

In Visual Studio, is there a quick way to search for an object's usage in the code behind? This is something I do constantly and the way I am currently doing it seems a little clunky. I am using VS2005, WinForms, VB and CodeRush/RefactorPro. Currently I do the following steps: In Design View Click the Object. In the Properties Dialog...

Pass key press from win forms to wpf

I have a windows forms Form that has a menu bar that grabs Ctrl-C. Inside the form's copy handler is a switch statement calls the correct copy method depending on what kind of control is selected. I have now added a WPF UserControl as one of the child controls. In the UserControl, is a TextBox. I would like to have Ctrl-C activate th...

Why is my ListBox throwing an exception?

Okay, I was able to create a simple WinForms project that reproduces some strange behavior I found. In the designer, make a Form with a ListBox (named lbx) Anchored Top,Left,Right,Bottom, and a Button (button1). Now, the Form's code is here: using System; using System.Windows.Forms; namespace ListBoxKaboom { public partial class ...

Crystal Reports in Visual Studio - Can margins be dynamically changed?

I have a report where the first page has a certain top and bottom margin. Every page after that will have a different margin from the first. Is there a way to do this in Crystal Reports in Visual Studio 2008? ...

How to make a form behave like windows taskbar using c#

I have created a taskbar using tabcontrols which works similarly to the Windows taskbar. I want to make my own taskbar fixed on top of the windows. It should not be movable, resizable, and it should be "docked" to the top. ...

How to create custom GUI components?

Hi. Im a C# coder with a intresst in building new GUI components. Have seached google for some info on creating GUI components not belonging to any current standard, with out mutch luck. In short I want to be able to build my own components/controllers to be used for the application. The thing is I had an alternerate idea for creating...

Send E-mail using .NET - Not so easy.

Hi all, For about a year now, I've had problems trying to send and receive email programmatically using Visual C#. Not a single example out of hundreds that I've found on the web have ever worked. And no, I don't just copy and paste. I study the code, and modify/add/remove as needed. Can somebody PLEASE help me sort this out. I'm tryin...

Databound DateTimePicker fires validation error

I have a databound DateTimePicker: dateDateTimePicker.DataBindings.Add(new Binding("Value", paymentBindingSource, "Date", true); paymentBindingSource.DataSource = payment; payment is Entity Framework object. payment.Date contains valid DateTime. When form is shown, dateDateTimePicker contains correct value, but an ErrorProvider is sho...

Is there a good .Net component for drag/drop/resize drawing in 2D with connections (like Visio) ?

Is there a good .Net component for drag/drop/resize drawing in 2D with connections (like Visio) ? ...

Windows form rotation

When you create a form in .Net it appears as a dialog box in a portrait layout. No one normally likes to read sideways, or upside down, but I have a very valid reason to rotate the form. Anyone knows how to do it on Windows Vista with C#? ...

Problems with Exception Handling in Winforms application using a global error handler

I have a Windows Form application that has a global error handler to display unexpected errors. Namespace My Class MyApplication Delegate Sub ProcessParametersDelegate(ByVal sender As Object, ByVal args() As String) Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBa...

C# WinForms - TreeView, Context Menu

Suppose I am using a context menu to add child nodes to a treeview control. (1) I am right-clicking on the node (2)context menu pop up (3)then I click "Add" menu item (4)a dialogBox opens up (5) I input the name in that DialogBox and press OK (6) A new Node is created. How can I get the reference of the current Node when I am clic...

WinForms, BindingSource, prevent CurrentItem change

How can I prevent bindingSource Current item from changing? (there is no changing event with cancel argument...) This is scenario: I have a dataGridView, and text-boxes on the same form. I am using text-boxes to change values in the datasource (with standard databinding) Bindings are written manually (After save button is clicked) Whe...

Can I change a web service reference URL in the Config file?

I have an application targeting the 2.0 .NET framework. The solution is using the VS web service reference folder. A grep through the solution reveals that this URL lives in a handful of files. However in the deployed application a search shows that the URL lives in only the .config. So what happened to the .disco and .wsdl? Are they com...

Inspiration to get rid of MDI UI

Microsoft seems to want us to stop using the MDI, but if more people are like me they're stuck on how things used to be. Software like Word and Excel is simple to create without MDI, but I have trouble thinking out good UI without MDI. Is there a place where I, and others like me, can see examples on how to make great WinForms UI witho...

IDataErrorInfo in winforms

Can IDataError info be used properly in a winforms application? In the past I was doing my binding the usual way(1) and did the validation in the OnValidating event of the particular control. I would like to move the data validation to the domain model so that I can easily swap out user interfaces and so that all of the logic is in one p...

.NET / WinForms - Clear a Sort on a DataGridView

What is the proper method to tell a DataGridView to stop sorting? I have a "screen" where I tell the grid programatically to sort by column 4 and ascending. When I switch to another area I want the same grid to come in 'default'/no sort. I'm removing all the columns and adding new ones. The sort remains on the 4th column. I don't see a...

How to export to excel from a winform vb.net 2008 without office installed?

Hello, I am building a windows form application using visual basic (visual studio 2008). The idea is to query a MySQL DB and export the results to an excel document. I managed to do this using this code (I will just show the export to excel part): Imports Excel = Microsoft.Office.Interop.Excel Imports System.IO Imports System.Da...

Winforms: where should assemblies that go with the application be published

Very simple Winforms application I want to deploy manually. Can all the referenced assemblies simply go in the application folder or where should they be published? (In ASP.NET they can go in the \bin folder). I would rather not put in the GAC. ...

GDI+ General Error on ScreenShot

I have the below Exception Extension for my in house Winform App. My problem is that I get a generic GDI+ error on ss.save("C:\\HelpMe.jpg", ImageFormat.Jpeg); It is not every time as it will work and then error out. Sometimes it will work a couple of times in a row. Is this a "locking" issue, possibly? What else should I look at ...