winforms

VS.NET 2005 Form Designer - Can pages inherit their size from a parent, and can I see it in VS designer view.

I have a group of pages I want in the same size. I want to be able to change the page size in the designer view of visual studio, and that all the other inheriting pages size will change. I am currently working with VS.NET 2005 Form Designer is this possible? ...

ComboBox & SelectedItem setting on dropdown opening

Hi all. I have a ComboBox control of DropDown type which contains items "Vx", "V", "G", "g". Edit field text is "V" ( :) The problem is: when I open dropdown list, item "Vx" highlighted as selected, not "V". So I assume combobox uses FindString to find SelectedItem - so search result is equivalent to first matched item by case-insensi...

ComboBox:How do i set the height of ComboBox?

I have a ComboBox a on form, and its' default height is 21 - how do i change it? ...

c# counting clicks

I have a timer and in 30 minutes I want to count clicks and show it in a textbox. but how? here is timer code: decimal sure = 10; private void button1_Click(object sender, EventArgs e) { button1.Enabled = true; timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { sure--; label3.Text = sure.ToString(); if (...

WinForms UserControl image resource

I am developing a user control and want to save an image as a part of that control. I added the image to the control resource, but I can not access the image using code (like Properties.Resources.etc) Any tips? ...

Panel Size keep getting smaller

I got many panels and one form. I have employed panels so I don't have to use multiple forms. But there is a problem with it. After I assign the panel size to the form size and show the form, the next time I assign it again, and to my surprise the panel gets smaller than the original. Why is this happening? Here is how I'm doing it. thi...

Simple ListView Question

Hi All When I click a button, I am trying to insert a new listview item. It is supposed to go in a certain Group, and it will have an item, followed by two subitems. But my code isn't working. ListViewItem lvi = new ListViewItem(itemtext, grouptext); lvi.SubItems.Add(subitem1); lvi.SubItems.Add(subitem2); ...

Integrating "Help" into WinForms Application

I am working on a Visual Studio we need to integrate help menus into it. I would like to do this in the canonical Windows fashion but am not very experienced with the .NET framework in these respects. Searching Google and SO hasn't yielded much because most of the results are people asking for help, not help with "help." Meta-help, if yo...

Setting SelectedIndex in ComboBox DropDown eventhandler

Hello! Recently I reproduced strange behaviour of this message at my Windows 7. May be it is a feature, and may be it is not depends on Windows 7, please correct me if it is right behaviour. In MSDN we see An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls t...

Simulate button click

How can I simulate a visual click on a button in my form( WinForms ). I don't mean "Button_Press(MyButton, new KeyPressEventArgs());" I want the user to see(visually) the button being clicked. of course i don't want to use SendKeys.Send("{ENTER}") or other functions from this kind thanks you. ...

How can I display different values in a DataGridViewComboBoxColumn drop list than in the text box?

I have a DataGridViewComboBoxColumn where I'm supposed to display different values than are selected, much like what's going on in this question: http://stackoverflow.com/questions/1390462/datagridviewcomboboxcolumn-name-value-how In my case, I'm displaying lists of equipment which have an ID and a description. So my bound data class l...

Trying to create DataGridView from key-value pairs in C#

In a Windows Form application, I'm trying to create a DataGridView with two columns: one for the key given by an XML element and one for the value of said XML element. This is my code so far: this.myData = new DataGridView(); ((System.ComponentModel.ISupportInitialize)(myData)).BeginInit(); myData.Location = new...

Is there a freely available "Spinning Wheel"-like control anywhere for Windows Forms?

We've all used the ProgressBar control, and it's great. Sometimes, though, you want to indicate to the user that work is being done, even though you can't determine what percentage of the work is finished or how long it will take to complete. On some operating systems, you can set Style = ProgressBarStyle.Marquee; but this isn't suppor...

How to databind to a label with a custom object collection in C# winforms

I'm using a VB power packs data repeater control. I need to bind a list of custom objects to labels inside the repeater. The following code works except for the Tip.User.UserName binding. How can I bind to a property of an Inner class like Tip.User.UserName public interface ITip { DateTime Date { get; set; } int Id { get; se...

Auto size list view column based on contents

I'd like the size of one of my columns in a list view to always be wide enough to display the longest item. I read somewhere that setting the column width to -1 would cause this auto sizing behavior but I've not been able to get it to work so maybe that is specific to the full framework. How can I do this on the compact framework? ...

Page_Load Paradigm in Windows Forms?? What is it??

So I have a windows forms application and I have a drop down that is bound to a dataset. Upon load I want to bind the control to the database value. I have some validation that takes place but I only want this to occur after the form has loaded and the user changes a value in the drop down. Currently I have the code in a _SelectedIndexCh...

How to solve this combo box issue in datagridview in .net winforms?

i had two combobox(Catogery, product) in my grid. what i want to do is. if i select category it will display some data set value based on category, and if i select product it will bind some values in that datagrid cells.like price quantity.. i don't have idea about how to write event for combo box selected index change event which is i...

Windows Forms/DatagridView Screen Flickering

Has anyone experienced a case where a .Net Windows Forms app caused severe desktop flicker? I have a Windows Forms app (.Net 3.5 , C#) with a datagridview in a usercontrol. Occasionally, while running other applications at the same time (I see it with Louts Notes, but the worst behavior is a user with Reuters Bridge Station) , switchin...

Interface Controller (ViewModel) for multiple UI's

I am currently designing a new .NET application and would like to keep it UI independant. Whilst I initally would like to use WPF, I would like to have the option of swapping the UI to ASP or WinForms if necessary. In a layered design: View - Interface Controller (ViewModel) - Model - Persistance is it possible to design the Interfa...

Background Worker C# winform

is it a bad idea to load everything in from the background worker?? Current code is Executed on Form_load. we are pulling a lot of data from webservice. some long running works are in background worker. would it be a bad idea to load everything from background worker no matter how small or big the code is?? every function to run in bac...