winforms

Is there a way to get different sizes of the Windows system icons in .NET?

In particular I'd like to be able to get the small (16 x 16) icons at runtime. I tried this: new Icon(SystemIcons.Error, SystemInformation.SmallIconSize) Which supposedly "attempts to find a version of the icon that matches the requested size", but it's still giving me a 32 x 32 icon. I also tried: Size iconSize = SystemInformation....

How to solve the Winforms Control.Invoke Error?

How to solve the "Control.Invoke must be used to interact with controls created on a separated thread" Error Exception Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); serverSocket.Bind(new IPEndPoint(IPAddress.Loopback, portNo)); serverSocket.Listen(5); ...

C# settings using ApplicationSettingsBase - roaming and common

I'm using the Windows Forms Application settings architecture (or however you're supposed to refer to it) and am successfully saving user settings to AppData. What I want to do is have some settings common to all users of a particular machine and some settings which roam with users across machines. For example I have some settings relat...

Link label is cut off at the buttom c#

Hi, In my C# winform application I have a link label. when the text in the link label is localize to chinese the text is cut off at the buttom by the line of the link label. Any idea? ...

Selecting one row when working with typed datasets.

I have a typed dataset in my project. I would like to populate a datatable with only one row instead of all rows. The selected row must be based on the primary key column. I know I could modify the designer code to achive this functionality however if I change the code in the designer I risk that this code will be deleted when I update m...

How to remove the inner border from a certain column in a DataGrid?

I have a DataGrid that needs to have the following borders: ------------------- | | | | |________| | | | | |________| | | | | |________| | | | ------------------- How do I set the border for a certain column and keep it for the rest of the datagrid? This is...

Save Settings in a .NET Winforms Application

Possible Duplicate: What is the best way to store user settings for a .NET application? I have found alot of VERY different examples as to how one would save application settings (per user) from a Winforms application. I imagine that the correct way to do this is very simple in c# and am hoping someone can enlighten me? ...

What Application.Run( ) does ?

Hello Everybody I was thinking that WinForms are classes as any other classes. But starting form project get me confuse. Why new Form start with Application.Run and what kind of mechanism happen inside of it ? ...

Communication between forms in C#

In C#, using winforms, what is the best way to make forms talk to each other? Sending data, messages, strings, whatever, from on to the other? Delegates? Ideas? ...

Simple question about WinForms and ListView

Hello I have a ListView in my WinForms application. ListWiew has 4 columns. So i want to write string in fourth column on every LisViewItem. When i try it. foreach (ListViewItem item in lvData.Items) { item.SubItems[3].Text ="something"; } i get an exception InvalidArgument=Value ...

Winform problem with autoscrolling of the ScrollableControl

Hi guys, I have a problem with autoscrolling of the .NET ScrollableControl. I am using TabPage which inherited from ScrollableControl in the class hierarachy. Every TabPage object has only 1 UserControl derived control which draws the landscape; there is no other control on the tabpage. The usage of my application is its user will dra...

Convert Windows Form OnPaint to equivalent WPF shapes

I have an existing OnPaint method which draws some shapes: protected override void OnPaintBackground(PaintEventArgs e) { Graphics g = e.Graphics; g.CompositingQuality = CompositingQuality.HighQuality; Brush greenBrush = new SolidBrush(Color.FromArgb(73,172,113)); Brush blueBrush = new SolidBrush...

Custom Detail in Linq-to-SQL Master-Detail DataGridViews

Hi, looking for a way to create Linq-to-SQL Master-Detail WinForms DataGridViews where the Detail part of the Linq query is a custom one. Can do fine this: DataClasses1DataContext db = new DataClasses1DataContext(".\\SQLExpress"); var myQuery = from o in db.Orders select o; dataGridView1.DataSource = new BindingSource() { DataSource...

Free WinForms image editor control

There are a lot of image editors in C#, but I need only the control, that encapsulates the editing and that I can place on my own host form. Does anyone know of any such controls? Thanks you in advance. ...

messagebox with "Yes", "No" and dialogresult?

I want to make simple Y/N messagebox but I think it is nonsense to design a form for that. I thought I can use MessageBox, add buttons etc. It is simple but since there is no dialog result, I don't know how to retrieve the result? ...

Resizing Grid Views On Window Resize

I'm making a small Windows Form application that contains a lot of grid views. I want all the grid views to resize with the window. I could make a function that detects window resize and then changes the size of each grid view but that feels a bit clunky. Is there an easier/more intelligent way to do this? ...

VS.NET 2005 Windows Forms Designer - "Object reference not set to an instance of an object"

I have a windows form that I am adding some new functionality to. The form has roughly 100 controls on it. I discovered when looking at the "properties" dropdown that there were several dozen controls in the form that served no purpose and were not visible on the form when they were selected in the properties window. I couldn't find an ...

Prevent painting of .NET form while form is loading?

Is there a way to turn off all visual updates to a .NET form while I am manipulating it? When my program first loads, for example, I set the tab control to the tab that was last open. The user can see the program switching tabs. I have looked into SuspendLayout and ResumeLayout, but either I don't understand what they are doing, or I ...

Two List Boxes side by side and stretchable

I have two list boxes like show below, side by side. They both have anchors on top, bottom, left and right. When I stretch the window the left listbox grows over the right one. While I want the margin between them to stay and for both listboxes to expand evenly. Is there anyway to achieve this? Thanks! ...

i am using .net window application . i need to make my form UI better. how to do that?

i am using .net window application . i need to make my form UI better. how to do that? Is there any predefined shins available?... I am new in this suggest any good idea... ...