winforms

Binding String Collection to ListView, Windows Forms

I have a StringCollection that I want to One Way Bind to a ListView. As in, the ListView should display the contents of the StringCollection. I will be removing items from the collection programatically so they don't need to interact with it through the ListView. I have a Form with a Property, like so --> public DRIUploadForm() {...

Progress Bar Only Appears After Work Is Complete?

I'm trying to make a progress bar show up on a form, but for some reason the form isn't actually visible until the process is over, and it is closed when the process is over (or in other words, the form is only open for an instant). How can I make it so the form shows up at the beginning of the process? Note: my code might not be 100% ...

Prevent taskbar activating non-modal forms when a modal dialog is active

I want to prevent activation of all other forms in my winforms application when any dialog is modal. This is how Outlook operates - open two new mail messages, open the address book from one message and you cannot activate the other mail message using either the taskbar or by clicking on the message window. How can I do this in a winfo...

Using interrelated listboxes to represent available combinations in Windows Form/Control

I'm trying to provide a simple way for our users to select a desired shipment method (ie: UPS ground) without having to know it's corresponding ShipmentMethodID. There are three key aspects of every shipmentmethod that uniquely identify it: Courier (ie: UPS, FedEx, OurTruck, To Be Determined) Service (ie: Ground, 2Day10am, To Be Dete...

Why put standard dialogs on a form?

I have some legacy code in C#, .Net 2.0 where someone dragged OpenFileDialog and SaveFileDialaog from the toolbox onto the form. This results in the open and save dialogs being instantiated when their parent dialog is created and remaining until the parent dialog is closed. The open/save forms are really only used in one place each for a...

Why does one class contained in a namespace not see another one contained in the same namespace?

Hello, I've been working on an application and I've run across an unusual error that I've never seen before. I have two classes, one being a UserControl and one being a Form, set up like so: namespace NC { public partial class Board : UserControl { // stuff } } namespace NC { partial class Board { /...

How do you print a string to the printer in c#?

Hello, I need to print a string from a textbox. The string should print through the default printer weather it is a parallel printer or a usb printer. Can this be done. BTW..I am using .net Forms ...

Printing complex Winforms

We've got a complex Winforms app with each form potentially containing multiple sub forms and have a requirement to be able to print the data contained in these forms. Currently we are using the PrintDocument control. For each form (or form element) that we are looking to print, we are calling the Control.DrawToBitmap() method, then dra...

Why Invalidate() should be called outside the control then it can work ?

I am using C# + winforms to develop software. I have a UserControl which contains several DataGridView datagridview1.datasource = from p in dc.doctor select p; I use linq to sql to populate the dataGridView with dataSource, because I need to refresh the datasource to update the records, so I create a new dataContext and assign the d...

Windows Forms find all the active Form instance types.

WinForms, how to find all the active windows of specific instance type. ...

Merging MDI toolbar

In .net MDI application the menu of child form automatically is merged to the menu of parent form. Is there a way to do similar thing with the tool bars.The concept is to send the toolbar of active child to the parent toolbar stripe. I found http://community.devexpress.com/forums/p/5696/24663.aspx but could not achied it. ...

Best practice for User Control Data Binding - How to achieve this?

Hi folks, I've got an User Control with TextBoxes, Labels, ... . Now I would like to get the same Data Binding Features like I would place the Controls directly on the Form. I tried with an extra Binding Source and Error Provider in the User Control and I tried to make the Properties of my Controls available as an property. Nothing wor...

Using control.Visible returns False if it's on a tab page that is not selected

Hi, I have a form with 2 tab controls. Form opens on tab 1. I have a few controls I need to validate on tab2. If the controls I want to validate have been set to not Visible then I want to ignore validation. (i.e. The controls have been hidden from the user) Problem is all the controls on tab 2 return Visible=False, because the Tab is ...

rss in windows forms

Hi guys, I'm developing an application in windows forms with C#, and I'1d like to know How could I use Rss Toolkit in Windows Forms Application ? I've referenced in my solution but it doesn't work very fine, an error apper when I compile the app. Is there any easy way to read Rss (Feeds) in Windows Forms ? If someone can help me.. I a...

Finding the char index of a Font Style in a RichTextBox

I'm looking for an efficient way to find the character indexes of different font styles in a RichTextBox. I have the following: for (var i = 0; i < index; i++) { _activeCopyBox.Select(i, 1); if (!linkFound && _activeCopyBox.SelectionFont.Underline) underLineFound = true; } This however is very slow as it has to select ea...

How to display an busy indicator in a long running C# .NET CF 2.0 process?

I need to display a "busy" indicator in a form while executing a long running single command (ReadXML or WriteXML). So far, I'm using Cursor.Current = Cursors.WaitCursor; but I'm looking for a more adqeuate way to do it. There's no need to display the percent done, only a visual reference that the program is working (like a Progress...

Problems submitting DataGridView changes with Linq-to-SQL

I'm trying to implement database value edition through a DataGridView control but honestly I'm having a hard time trying to accomplish that. I'm basically using LINQ-to-SQL classes and events, the following being the most significant snippets: var data = from q in data.FOOBARS select new { ID = q...

3D Graphing Package For C# Winforms?

I'm using ZedGraph for my 2D graphing needs, but for a project, I need something that does 3d graphing. What is the best package I can use for this? I'd like the Graph Panes to be as easy to manipulate as with ZedGraph. Edit: By 3D, I mean I want to be able to specify an x,y,z to get a surface. Thanks! ...

Fast way of going from Excel to a DataSet or DataGridView

I have data that I'm taking from an Excel sheet with the ultimate goal of displaying in a DataGridView. Currently I am just going over the UsedRange of excel data and plugging it into a datagridview. This works fine, but can get bogged down when there 100+ rows of data. I have also toyed with going from excel into a dataset (using the ...

is it possible to use Winform components in WPF

Hello All, We have a product which is developed using Winforms - .net 2.0. Now we are thinking about migrating this application to WPF. Is is possible to use the same Winform components in WPF. Or if it is not possible, then which is best possible ways to Migrate this application to WPF. Thanks and regards Harsha ...