winforms

Highlight of ListView items without setting the focus

In my situation there is a textbox that I am typing in it and then there is a listView that jumps to the item I am typing in the text box so the FOCUS should always be in the text box so I can continue typing! But as I said when it is selecting the item in the ListView I want that item to be highlighted with BLUE background as other sta...

Winforms combobox compare

am using two combobox in my C# .net windows application like combobox1 & combobox2(two combobox contain same items) if am choosing any items in combobox1 i need to hide that value in combobox2. Am having problem in this ...

How to hide the tool tips

Hi all, I am having a treeview with some nodes. I am also having a panel. I have taken some usercontrol forms and i will load those usercontrols when corresponding node is selected from the child hood. Now what i need is have some validations like if i left the text box empty i will have some tooltips displayed to the user. Su...

Databinding a List of custom objects to ComboBox collection

I'm working on a project that controls multiple devices over USB and intercepts the WM_DEVICECHANGE events from Windows to manage currently connected devices and plugin modules using those devices. There exists a combobox on the main form that (should) display all available devices (the custom object) and be dynamically updated in the ev...

How do I find which rows have been updated in the underlying Datatable on updating the Datagridview?

This is what I am trying to achieve : 1)DataTable populated using data from non database source 2)This table is bound to a DataGridView using BindingSource 3)The DataGridView is updated by the user, so that some cells now have new values. 4)Because the table is bound to the datagridview its values are updated. How do i get only the updat...

Proportional Transformation

I have a form where user can add and position charts and controls for a presentation like app. User can then change it to FullScreen mode, How do I change the size and position of controls to keep a relative position and size? ...

Scaling two Windows Forms controls while keeping the same ratio

I have 2 controls in a resize-able panel (1 datagridview and 1 textbox) with some space betwen and I need them both to scale in all directions with the panel. Problem is, since they're vertically stacked they run into each other when the panel scales vertically. I think I need some way to scale vertically while keeping the same ratio of ...

Keeping One Split Container Panel Fixed Width?

I can't seem to figure out how to keep a panel's width fixed in a Split Container in a WinForm. Any suggestions? ...

How do I make a Control follow its parent in a scrolling TreeView?

I've got a TreeView with a bunch of child nodes in it, all of which have child nodes of their own. A user asked me to provide auto-completion when editing any of the "grandchild" TreeNodes, so I had to implement a floating TextBox that sits directly over the TreeNode. Problem is, if the user scrolls the TreeView with her middle mouse b...

How to enable "Caret Browsing" functionality in WebBrowser control in C# or VB.NET

Hi, I have IE 8 installed on my machine; and trying to integrate the "Caret Browsing" (navigation using Keyboard) concept into application which i am planning to develop. My sample application in VB.NET as follows: A Form - Form1 A Text box - TextBox1 A Button - Button1 A WebBrowser control - WebBrowser1 Added following line of cod...

Can't resolve problem about EntityClient connection inside VS2010.

This is a strange one, i resolved it once but now i can't think what is missing here. I have a library contains 3 SQL CE databases. I created 3 Entity Framework 4 Models for each database. Then i created a library where contains 4 UserControls, 1 of 3 contains the other 3 Controls, and o drop this one control into the MainForm in the Wi...

Why isn't the PrintPreview exactly the same as the paper print?

Okay, before you spam me with StringFormat.Alignment = StringAlignment.Center ... hear my whole issue: When I draw text with the following code, the string is centered in the PrintPreview, but NOT CENTERED on the actual paper when it prints. The whole page is off to the right just a little, thus some stuff shows as printing on the print...

DataGridView bound to BindingList does not refresh when value changed

I have a DataGridView bound to a BindingList (C# Windows Forms). If I change one of the values in an item in the list it does not immediately show up in the grid. If I click on the changed cell, or minimize then maximize the window it updates properly, but I need it to happen automatically. I had the same problem earlier, but in that si...

How does one have the C# designer know the default property for a Padding or other object/struct in C#

How does one tell the designer the default value of a Property when it is not one of the types supported by DefaultValue()? For instance, a Padding, or a Font. Normally, when you use a Windows Forms control, the default values will be in a normal font in the Properties window, and changed (non-default) values will be in bold. E.g. In...

Problem creating datatable via code and binding to a datagridview

Hey, I am trying to bind my data table inventorytable to the datagrid viewer.the problem in the code is when it compiles,it says the column"make" does not belong to the table but I make the column in the code as follows: public partial class Form1 : Form { List<Car> listCars = new List<Car>(); DataTable inventorytabl...

Statistical usage of WPF / Winforms / ClickOnce / ...

I'm after some sort of statistic of usage of WPF in programming application. Is there any reference online or stats, such as the browser usage stats, for WPF vs Winforms, ClickOnce vs MSI, C# vs. VB, etc.? Also is there such thing per year? (ie. tracking the evolution in the usage of WPF) I've googled but no luck so far. Thanks. ...

DataGridViewCheckBoxColumn prevent user from setting indeterminate state

I have a DataGridViewCheckBoxColumn. I want the users to be able to set the value of this column to true or false. However, this column is only available if a different column has a specific value. When the column is not available, I set it to readonly and will set the value to indeterminate (null). However, the when the column is avai...

How to find out which javascript or stylesheet file load failed in WebBrowser?

Dear all, I have a WinForm application which display some local html file with the WebBrowser, the html file also have some linked stylesheet file and javascript file and these files should be deployed with the application and html files. But sometimes we miss some javascript or stylesheet file in the deployment package, now I want to lo...

Data templates in WinForms

Hey guys I'm trying to have a grid that has items that have a custom layout/feel. If you have a look at the following http://mdavey.files.wordpress.com/2007/05/ldmain.jpg this is kinda what I am trying to do (see the aqua/red pods on the left and the graphs on the bottom right). Under WPF/ASP.Net I would know how to do this but in WinF...

Interacting with two UI threads using different windows

My application is using an image processing library to handle a long running task. The main UI with settings and controls is implemented in WPF. The image processing needs to be displayed and the main UI needs to remain responsive. Upon clicking the 'process' button in the main UI a new thread is spawned which creates a new WinForm windo...