winforms

WinForms Chart Control autoscroll

Hello. I've got a bar's graphic in a chart control in my app. I've set the properties as this code shows: Chart1.ChartAreas("ChartArea1").AxisX.ScrollBar.Enabled = True Chart1.ChartAreas("ChartArea1").AxisX.IsLabelAutoFit = True Chart1.ChartAreas("ChartArea1").AxisX.ScaleView.Size = 40 I did that becaus I wanted to fix the columns wi...

How to display data from XML file to ListView using LINQ to XML?

I'm having an xml file like <Root> <Child val1="1" val2="2"/> <Child val1="1" val2="3"/> <Child val1="2" val2="4"/> </Root> i need to display the data from the Xml file to a Listview like (Added A to index value) Now i'm using like 1.Stores the data in an XmlNodesList 2.Then iterate through the nodeslist and add the attribut...

is there any way to get file name from any path ?

hi is there any way that i give path and i receive the file name ? for example: i give: c:\MyPic\OldPic\me.jpg and i get: me.jpg thank's in advance ...

Explorer window like address bar

The file system explorer window in Vista and Windows 7 has a bar at the top of the window where one can type in the address to look at. When you leave the field it turns from being a text edit field to a field with buttons and drop down menus that can be used for navigating. Does anyone know if this component is accessible in a winforms...

Isolating Actual Resizing And Not Moving?

Hi, I can see that the ResizeBegin and ResizeEnd events are triggered also when a form is moved. How can I trigger this code only on a resize and not on a move? ...

Putting A Specific Row From Linq Result On Top?

Let's say I have a linq query like the one below var LinqResult = from a in Db.Table select new {Table = a}; From here, how can I grab a specific row from these results and put it on top? ...

NotifyIcon on startup

I trying to make a visible tray-icon of my program in windows startup, with the NotifyIcon component. The program itself works great and the tray-icon showing up. But, when i placing my program in computer startup, the tray icon not always showing up, while the program itself is running without any problems, and its main window is visi...

winforms Label flickering

Hi I have a problem with the Label control that is terribly flickering. Below is some code to reproduce the problem. How to solve this? UPDATE: The solution for the previous case (a Form contains a Label directly) was to make the form.DoubleBuffered = true. But this is not a generic solution. For example, what should I do in the case...

Paint application in visual C#

I have created a simple paint application in VC# 2008 with the help of a YouTube video. Its code is as here: http://paste.pocoo.org/show/268704/ The problem with the code is that if I draw something in the picturebox, minimize the application, and thn maximize it, whatever I had drawn, disappears. The picturebox becomes clear. Why is i...

How to repaint a WinFormsHost when it becomes visible?

I've a winforms control within a WindowsFormsHost on a WPF control. The WPF control is only visible some of the time, and when it becomes visible the contents of the winforms control have usually changed. When the ViewModel for the WPF control changes I change the contents of the winforms control and the WPF control becomes visible. Un...

Windows Forms Event Subscription c#

Hello, I have a sample form with 3 windows. Each window has a label and the main form has a button. I have a class with the following code: public class CustomEventArgs : EventArgs { public string Message { get; set; } public CustomEventArgs(string message) { Message = message; } } public delegate void Cus...

Creating a GUI with different components

I want to develop a WinForms application and the purpose of this application is creation of a GUI with different components. I should have two forms: The GUI designer. It allows selecting components like Combobox, TextBox, Button, etc. for the form. It allows make changes for properties like Location, Size, Visible, Caption. It allows ...

Retrieving properties from a GUI object in a thread

Guys, I have a C# program that executes a thread. Inside this thread, I have the following code: string strDropDownValue = (string)ddlVersion.SelectedItem; I am trying to retrieve the selected value from the drop down list. This line works, obviously, in a single threaded application. Because I'm doing this from a thread though, I ge...

"Parameter is not valid" Thrown from System.Drawing.Graphics.GetHdc()-- Only on Some Machines

I encountered this error "Parameter is not valid", and it is thrown from System.Drawing.Graphics.GetHdc() The weird thing is that it is only thrown this error on one machine, but not on other machines. Sorry for being vague, any idea you have that can solve this problem? ...

can I convert windows forms based desktop app to silverlight ?

Hello! What is the simplest way of converting my .NET C# windows forms app to a silverlight app? Thanks! ...

How can I set the Properties of a DataGridViewComboBoxColumn in a thread? (C# Winforms)

I'm studying delegates and simple threading, I tried it in a ComboBox control, and experimented in a DataGridViewComboBoxColumn (cause I thought it would be the same) but it seems there's no Invoke property for this kind. How can I set DataGridViewComboBoxColumn properties in a thread? Please see my code, this works for setting the prop...

TreeView: checkboxes only in child nodes

I need a treeview control: Root nodes don't have checkboxes, only images. All child nodes have a checkbox + image. C#, .net 2.0, winforms (not wpf) ...

How will I know if my thread is already done doing tasks? (C# winforms)

With the code below, how will I know if my thread is already done doing tasks? My purpose is to kill that thread in order to free memory. Or how should I do it? private delegate void DelegateSetProperties(DataTable dataSource, string valueMember, string displayMember); Thread thread1; DelegateSetProperties delegateSetProperties...

how to load image from button1 to button8 in my form ?

hi i have 25 button's in my form button1..button2......button25 i need to load image only from button1 to button8 (in any loop) how i can do it ? thank's in advance ...

how to allow to type text in combobox placed inside datagrid ???-winform using c#

how to allow combobox placed inside datagrid to type text. it just binding the values already stored in the database. but i need to type the value in the combobox which is not shown in the binded values... how to make the combobox as editable column??? any help... ...