winforms

ComboBox SelectedValue property doesn't work

Hi iam trying to add objects into a combobox and use SelectedValue property to select and item in the combobox but it does not work, SelectedValue is still null after the assignment. class ComboBoxItem { string name; object value; public string Name { get { return name; } } ...

Scroll to first checked item in a CheckedListBox

How do I programmatically scroll to the first checked item in a CheckedListBox? ...

Reading wrong value from dataset

Hello All, I have a question related with dataset. I wonder why am I reading wrong value from a dataset? The field that I want to read has the value of: 2010-06-28 21:00:00 However, when I'm trying to read the first row using: DateTime endShift = Convert.ToDateTime(ds.Tables[0].Rows[0]["rep_time_to"]); I get: 04/07/2010 9:00:00 PM ...

Microsoft Based Touch/Stylus Input

Disclaimer:It's my first time developing an app that will be on a tablet style pc. The app needs to allow a user to write notes with either a tablet pen or by touch. This must be a .net app and may be on either Windows XP and/or Windows 7. I am mainly tasked with capturing written notes from the user interface, but I am sure I will be ...

Mimic/emulate a specific screen resolution for sizing WinForms?

I am currently developing a Winforms Application that will run on a very specific tablet PC. My development environment uses dual-17" monitors which are far bigger than the tablet screen size of 10.4" (1024x768). Due to the purchasing department at my company the delivery of the tablet will not be until well into the design cycle. ...

C# textbox appointment

Random r = new Random(); int sayi = r.Next(1, 49); textBox1.Text = sayi.ToString(); This code shows the first random number in textbox1, but I also need to get the output for the other textboxes as well: (first click)--->Textbox1: 3 (second click)--->textbox2: 24 (third click)---> textbox3: 32 ...

How to add a WPF window to a WinForms App

I'm creating a HUD window for inspecting biz entities in my WinForms application. I wanted to have a completely different style of window (minimize the content area and showing only the TitleBar, no system buttons, etc) so I created a WPF application for this. The problem is that I want this Window to 'live' inside my WinForms applic...

DataGridView data-bound to a list is not updated

I have a DataGridView databound to BindingSource which is in turn connected to a list of objects. After the data bindings are set up I'm populating the list from the background thread (using Form.Invoke of course). The problem is that the Grid is not updated. I can see in the debugger that the BindingSource contains items and DataGridVie...

Reflect underlying data changes in bounded WinForms controls.

Hi. I have scenerio like this: I have a BindingSource, typed DataSet and a ComboBox which property SelectedValue is bound to the BindingSource. On my form a have various controls but I guess the rule working for ComboBox will be applicable to the rest controls so I am describing a simplified scenerio. To insert a new empty row I run t...

Is there any themes available for .net windows application like wpf?

Is there any themes available for .net windows application like WPF? how to use that.where to learn it? ...

tab control, vertically aligned tabs with vertically aligned text

Hi, I want to use a tab control and have the tabs displayed on the left, as opposed to at the top. I have set the alignment to the left and the tabs are displayed there. However, how do I get the text to be displayed on the tab, vertically? I have looked at the msdn and it gives an example of a left aligned tab control but the tab la...

Question about adding controls to a winform

Hi, In .NET Winforms, if I have some code which does something such as execute a stored proc against a SQL Server but I do not know how many parameters there are, can I add more controls to the form with the controls appearing straight away? Thanks ...

How to know that a parameter is an array?

Hey all, I'm working with reflection and when I get the parameters' list of a method, I need to examine all of them, when I find any one which its type is an array I need to avoid it, I mean array of any kind, so I used the following which doesn't work: (!(parameter.GetType().Equals(Array))) The error was that I'm using a type as a v...

how to create Windows application installation/setup select component window?

I am creating a windows application setup project using Visual studio 2008 setup project. This setup will have following steps: Splash screen Select Installation folder/directory Database configuration Select Components I am having trouble finding a way to create such installation window in setup. could you please help me to find a s...

Bind a label to a "variable"

Hi all, Say I have a global variable INT named X. Since X is global, we can assume that anything can modify its value so it is being changed everytime. Say I have a Label control named "label". Here's what I want to accomplish: I want to "bind" the value of label.Text to variable X. In such a way that when variable X is changed, it w...

Navigating from one form to another

Hi This is a bit embarrasing but I'm not sure of the standard way to design a Windows Mobile Winforms application. Most of my experience is in Asp.NET. In particular what is the normal way to navigate between screens? I guess one way would be to have one "main" screen and open any other forms as modal dialogs. Another way would be to in...

Exception caught when project debugged from IDE but not when run outside of IDE.

In C#, WinForms, VS2008, .NET 3.5... For this code: static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(fal...

Enterprise Library Validation Block: Validating a nullable datetime

Hi, I'm trying to validate a nullable datetime using the Enterprise Library Validation Block without success. I've got a WinForm with a DateTimePicker with a visible checkbox. The DateTimePicker is bound to a nullable DateTime prooperty using a custom databinding where the parsing is done like this (if the DateTimePicker is not checked...

It doesn't draw above com-component ...

I have a graphical com-component from our vendor. I placed it in main form and want to draw above it. But MainForm_paint doesn't draw above that component. Is there any way to paint above that component ? C#, WinForms, 2.0 code: void MainForm_Paint(object sender, PaintEventArgs e) { using (SolidBrush b2 = new Solid...

How do I set the language for datetimepicker?

Is there any property to set the language for datetimepicker? When displaying the calendar, that is - if I want the week days to be displayed in Spanish, for example... ...