winforms

Windows Forms: add new line to label if text is too long

I'm using C#. Sometimes the text returned from a web service (which I display in a label) is too long and gets cut off on the edge of the form. Is there an easy way to add a newline to the label if it's not going to fit on the form? Thanks ...

Why in C# , in the control combobox , i can't change the property SelectedItem ?

I have a simple class called Tuple. which looks like this : class tuple { string name; string code } i inserted few of these items into a combobox, now when i want to select through the code some item, i try to write myComboBox.selectedItem = new tuple("Hello" , "5"); and of course it doesn't work at all and the selected ...

Does anybody know of a really good 3rd Party Treeview Control for C#

I am involved in a project where I have the need for a really rich treeview control. The application is written using WinForms in C#. The treeview control in .net seems to be fairly limited. It is lacking in several ways: multiselection, can't select multiple nodes at the same time poor drag support for repositioning items Poor label e...

Visual Studio's amazing disappearing interface elements

Hi folks. I'm building an interface in Visual Studio. All fine and dandy. Then yesterday I did some resizing and had a crash, not sure which of those caused it, but now the progress bar I was using has vanished from the form. I'm not getting any compile errors, so as far as I can tell it still exists and is just playing hide and seek wi...

type-bound custom ComboBox deriving from ComboBox

I am supposed to create a custom ComboBox by deriving a class from ComboBox in my WinForms application. I have never done this before and not able to find many good example from Google. I am required to derive a custom combobox so that I can make the custom combobox type-bound to a particular object. Could you please point me into ...

How to replace the text that was already exists in a text file and how can i insert text in between the lines of the existing text

Hi all i have a text file saved with some data as follows 101011111111101111111111009100954A094101 9000000000001000000000000000000000000000001000000000000000000000000000000000000000000000000000 Now i would like to insert data in between these 2 lines as 52201 1 ...

Take Screenshots of WebBrowser Control

Could someone please share the code to take screenshots of web browser control and save it in predetermined path. I am working with VS 2008 .Net 3.5 . ...

Check button like in "solution explorer" in visual studio

Hello guys, there's "show all files" check button in solution explorer tab in visual studio. How can I make such a button ? /* give me a class */ My manager wants exactly the same button and it's behavior .. Or is it not "free" button ? Edit: I see some people didn't understand my question. Some explainations: I need a check button...

How do i catch page cannot load message?

Hi i hope someone can help, In basic terms i am trying to stop the embeded browser, in my Windows Forms app, from navigating to the 'This program cannot display the webpage' page and instead display my own error page. The C# application is a Web Browser embedded in my Windows Forms, its purpose is allowing the user to click on the provi...

winforms control for viewing object details

hi. I need to display some sort of detailed information about an object in my custom win form application. something similar as visual studio uses when debugging. does any of you know something that might help. I know, I can write something on my own, but I don't intent to. thanks ...

Event handling in Usercontrol in winform

I have a usercontrol to provide a data grid view and using it in a form. I have a decorator for this data grid view which provides the grouping functionality to this data grid view. Now all times a cell is clicked, the data grid view cell changed event is fired first and then the grouper event. Is there any way to change the event firing...

To-do list(view)s with time displayed?

In a C# (3.5) Winforms app I have a FlowLayoutPanel containing a number of listviews. Each listview represents a short to-do list sorted in a sequential order with assigned priorities. Occasionally a user has to create a new priority 1 to-do item. An issue arises when there are multiple priority 1 instances - how does the user know wh...

winforms position and dimension properties

I'm trying to untangle all the position and dimension properties of winforms, and it would be really helpful if there were a comprehensive overview explaining the relationships between them. Many of them appear to be functionally equivalent, but I'm concerned I may be making some false assumptions. For reference, I am referring to prope...

Mixing WPF with a WinForm application?

My fairly large WinForm application needs a GUI overhaul, but I can't afford to do it all at once. I need to know if I can slowly add WPF into it, and if so, how? Can I add WPF dialogs? Can I add WPF 'panels' within a WinForm so that I can embed WPF elements? EDIT Can I do the opposite and put WinForm dialogs in my WPF application? ...

WinForms control for editing of a custom object collection

I have a list of some custom classes and an UserControl to edit one instance of the class. I want to have a control on a form which allows to add a new instance, delete an instance and edit any instance. What can you suggest for that? The control should take less space than all UserControls for existing object instance (i.e. have some f...

my C# winform needs to detect when other applications enter/exit/run-in TRUE fullscreen, prefer by events.

my C# winform application needs put itself in standby mode during time other application runs in true fullscreen mode (not only maximized), like video games, video movies, powerpoint. I need a method to detect if currently there is other application in fullscreen. Is there a possibility to register to events which will fire when other ...

How to make System.Drawing.Color both serializable and editable with propertygrid?

Basically i have a settings class like this: class Settings { Color BackgroundColor {get;set;} Color ForegroundColor {get;set;} Color GridColor {get;set;} Color HighlightColor {get;set;} //... etc } And i want to be able to do both - serialize the settings class and edit the colors in propertygrid. The solution I've come ...

How to properly bind to a child object?

I have an object Proposal which has a property called CurrentAgency of Agency which in turn has AgencyID, Name, etc...something like this: Proposal CurrentAgency AgencyID Name Address etc... In my UI, I have a combobox that lists all available Agencies. I have bound it like this: private BindingSou...

DataGridView binding problem: "Index -1 does not have a value."

I have a datagridview bound to a binding source and a couple buttons on a form. One button adds an item to the binding source, the other removes the currently selected item. There's also an event handler that listens to the CurrentChanged event and updates the Enabled status of the Remove button. Everything is hunky dory until I go to ...

how to find if listview item is checked

User chose a folder of files. I'm making a listview of files in these folder. I want to display what each file contains,but i want to display it when user check a file from listviewitem. I'm using these code: if (listView1.Items[0].Checked == true) { //.... } Why it doesn't work? What should i want to use data from for example: bu...