winforms

C# DataBinded ListBoxes - Sorting Issue

I have these ListBox es.. all of them are DataBind ed to same table and they are in a table type of manner, every row corresponds to its actual value in the datbase. When i switch selection(SelectedIndexChange) on any of these ListBoxes i change the SelectedIndex of all the other ListBox es. Now i cannot simply select "Sort = true" f...

How do you create a .NET winforms custom control that updates the designer?

I have created a custom user control like this (simple example): public class MyButton : Button { public MyButton() { BackColor = Color.Blue; } } After compiling, it shows up in the form designer toolbox, and is displayed with the updated property. But, if I change the color, the controls that I am already using o...

C# Autohide form

I've a winforms app that "docks" to the taskbar I'd like to autohide the form and make it appear only when the mouse goes near/over the form any suggestions ? ...

Disposing Controls on Winforms

Why does Visual Studio add this code to the Class.Designer.cs partial class. Can anyone tell me when this components variable is going to get some value? What's the pattern to follow here? private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </sum...

WinForm DataBinding Hide Property in business object C# .NET

My datagrid (DevExpress) automatically will populate a grid based on the public fields of a business object. What attribute can I place on the field to tell WinForm databinders to ignore it? [???HideFromDataBindingSources???] public bool IsSecurity { get { return _isSecurity; } set { _isSecurity = value; } } ...

C# and Storing Data in Memory

I'm using Visual C#.NET, and am making an app that uses winforms. I essentially need to open multiple files as strings, and manipulate the data in various places without saving the information back to the file. How do I go about storing this data so that I may use it in various parts of my code? ...

XtraGrid Suite - is there a way to add a button or hyperlink to a cell?

I'm working with the XtraGrid Suite made by DevExpress. I can't find any sort of functionality to do this, but I'm curious if you can add a button or hyperlink to a grid cell. Context: I've got an Events list. Each Event has a Time, Start/End, and a Category (Utility and Maintenance). There can be Start events and Stop events. Having do...

C# Applications Dependencies Check

I have an application that i wrote in C# and it does databases. So to run this app on any machine i need .NET 3.5 and SQL Server 2005 installed. Is there a way that when the application starts. It first checks whether SQL Server 2005 and .Net 3.5 exist on the machine or not. If not then it may exit and if they do they may continue. ...

how to add a picture onto the interface..?

I want to display a picture that is of jpeg type onto my interface. I want that picture to be displayed when my program is being executed. I'm doing this: private void frmMain_Load(object sender, EventArgs e) { LoadRecords(); Image.FromFile("@ C:\Users\cAndyb0eMeh\Documents\Downloads\images.jpeg"); } But this doesn...

Calling a javascript function from a textbox in winforms

I have textbox in one of my forms and i want to call a javascript function from a javascript file... My code is this.txtbox.Text = ""; this.txtbox.Location = new Point(10, 20); this.txtbox.Size = new System.Drawing.Size(200, 100); this.txtbox.Multiline = true; this.Controls.Add(txtbox); this.txtbox1.Text = ""; ...

C# Winfoms Printing

i have a winform, i want to print all the available data on the winform, lets say i have form full of labels, how to print it. ...

Way to quickly show/hide WinForms GUI C#

I'm creating an app that is threaded. I started GUI (Announce : Form) as separate thread. That window will be very minimalistic with one input box and maybe a button. On another thread there will be Tcp Client running and when it gets info from TcpServer it should pass what it gets into that inputbox and show the gui (and topmost window...

VB.Net: Looping through all form items, including CommonDialogs

Hello everyone! I'm translating my VB.Net application, and I need to loop through all the controls on my form. Using a recursive function such as Public Sub TranslateControl(ByVal Ctrl As Control) For Each ChildCtrl As Control In Ctrl.Controls ChildCtrl.Text = Translate(ChildCtrl.Text) If TypeOf ChildCtrl Is Label...

C# create an array of controls

Is it possible to create an array of controls? Is there a way to get the index of a control if more than one of the controls in the array share the same event handler? ...

Quickest/simplest way to refresh datagridview ?

I have problem with updating my datagridview after inserting new data to table. It seems DataSet ,to which datagrid is bound, does not refresh and i cant force it to do so.The only way to refresh dataset is to reset application. I know i can make new DataSet and fill it with table's data every button "Refresh" click ,but i wonder if its ...

Create a System-tray styled box in Winforms (C#)

I've been hunting about for some resources on this, and I can't find any, so I'll bring in here. I want to make a window similar in style to the quick launch box which you see when you open the quick launch bar: Sadly, I can't find any resources on this; can you help me out? ...

Major differences between Crystal Reports X and XI

After inheriting a project, I have two sets of apps: a set of Winforms apps, running on .NET 2.0, which use Crystal Reports X a set of Webforms apps, running on ASP.NET 2.0/3.5, which use Crystal Reports XI Both projects are being developed using Visual Studio 2008, and both Crystal Reports versions are full developer versions - not ...

how to highlight individual items in treeview in WF

Hi all, I'm building an application with treeview in windows form. I would like to change the background color/highlight individual items in the treeview based on some criteria. Does anyone have any suggestions on how to accomplish this? Thank you very much! Jason ...

LinQ To SQL And DataBinding

I have a form (WinForms) with a TextBox Binded to a Datasource. The datasource is a LinQ To SQL query returning one single row. This row have only one filed, varchar(100), not nullable. My problem is that if the user go to the field (with the focus), he can't exit while he insert a data because the data field cannot accept null. It is...

Creating Controls in a Class File

Hi All I selected Class Library option in C# Vis Studio Express to create a DLL which holds heaps of my commonly-used methods etc... I'm trying to create a textbox in the class file, so that when I add the dll to another project all i have to type is: MyControls.Create(TextBox); ...And it will create a text box and return it to me an...