winforms

How to filter ComboBox values in winforms

In a .NET winforms application, how can I filter the data in my 2nd ComboBox with respect to the value selected in my 1st ComboBox? ...

I can't find my custom TextBox control in Visual Studio

Hi, I'm creating a custom WinForms TextBox control, like this: class MyTest : TextBox { protected override void OnEnter(EventArgs e) { this.BackColor = Color.Yellow; } protected override void OnLeave(EventArgs e) { this.BackColor = Color.White; } } When I build the project, I cannot see the con...

MessageBox bold text

Hi, How to show the text in bold in messagebox.show for c#? Any suggestions? Thanks, Karthick ...

Upload / Download file from SQL Server 2005/2008 from WinForms C# app?

I'm using DocX to create .docx files. Instead of storing them on hard drive, Share or SharePoint i would prefer to store them inside SQL Database. So my questions are: How to write proper code to save file to that database? How to write proper code to retrive file to that database? What kind of datatype should i set for a table to hol...

Override Winforms ComboBox Autocomplete Suggest Rule

Hi, I'm trying to modify the behaviour of a Windows.Forms ComboBox so that the AutoComplete drop down displays items according to the rules I specify. By default, if you use AutoComplete in a ComboBox, the rule that's followed is "string s is included in the drop down if( s.StartsWith( userEnteredTextInTheComboBox) )" All I'm really i...

Win Forms text box masks

Hi everyone How can I put mask on win form text box so that it allows only numbers? And how it works for another masks data, phone zip etc. I am using Visual Studio 2008 C# Thanks. ...

How to get my VB.net form to focus above existing users windows and applications?

I have a Visual Basic .Net form (launches after the splash screen tests database connectivity) and it is not focusing above other existing windows on launch. How do I get it to focus above all existing windows and Windows Explorer windows? ...

Is there something like Snoop (WPF) or FireBug (ASP.NET) for Windows Forms?

I want to point with the mouse on an area in my application and know the name of the UserControl. ...

Why is Form.Refresh() not working?

I'm running a data import, using a Windows form to kick off the import and show progress. I've got this whole thing so nice and user friendly, with major and minor progress bars and everything... but just one problem... the form refresh keeps going AWOL. I have a call to Form.Refresh() every time I update my labels/progress bars, and it...

COM object that has been separated from its underlying RCW cannot be used.

I have some COM component which I call from some c# dll. I also have a winforms app that uses that .dll. When I close the app I get this exception: COM object that has been separated from its underlying RCW cannot be used. The stack trace shows this exception comes from a destructor in the .dll. I implemented this destructor ...

WinForms - Databinding to 2 tables on 1 form and saving to the database

I have a form that contains information about a client eg/Title, Name and their Address eg/Town, Country. I have a class for each table that has a Save method to update the database. I am thinking of having 2 bindingsources one for client and one for address. The controls will bind to the relevant bindingsource. When the user clicks ...

Is there a way to use a custom control in the designer and avoid the GAC?

There is a great library I found here. It's AeroWizard done in Windows Forms, and it handles Aero Basic elegantly. What is awesome is it's supposed to have designer support. When I attempt to open any of the WizardPages in the sample in the Form Designer, I get this error: Could not find type 'Aero.Controls.MainInstructionsLabel'. Pl...

TreeView, Access DB & Windows Form (C#)

hello friends I am in trouble, i have a school project in which I have to use tree view control to display fullname from DB in the following form. suppose A is super memebr & under A there are others, and under other there could be other memeber and so on. its like chain system which will show referred member in hierarchical view. Than...

.NET WinForms: suspend code until mouse move or keyboard press

In .NET WinForms I want to display message in a status bar and suspend the program execution until user moves mouse or presses keyboard. How can I do that? ...

vb.net - tab control?

I have a Tab Control on a Winform. I want to add another page but I want it to appear between the current page 1 and page 2, basically I want to insert it. How can I do this? ...

Keeping a global reference to a control in WinForms for accessing GUI thread

(There's a tiny bit of history to this question, please bear with me) In this question, I talked about the possibility of centralising the 'cross thread' hocus-pocus that is required for updating the GUI like so: //Utility to avoid boiler-plate InvokeRequired code //Usage: SafeInvoker.Invoke(myCtrl, () => myCtrl.Enabled = false); publi...

How can we block the user from unchecking a DataGridView checkbox?

We have a DataGridViewCheckBox column bound to a boolean property in our class. The property setter has some logic which says that under certain conditions a True flag cannot be changed, ie, it stays checked forever. This is on a per record basis. So the entire column can't be readonly, only certain rows. Pseudo code: Public Property ...

Simple Multithreading Question

Ok I should already know the answer but... I want to execute a number of different tasks in parallel on a separate thread and wait for the execution of all threads to finish before continuing. I am aware that I could have used the ThreadPool.QueueUserWorkItem() or the BackgroundWorker but did not want to use either (for no particular re...

How to fill an Windows Forms combobox using DbfDotNet?

I'm trying to use the DbfDotNet library (http://dbfdotnet.codeplex.com) and replace my current ADO.NET methods of reading a very large dbf file (350.000+ records). I've tried the existing samples to read my file and file their custom Dataview and I'm very impressed with the speed. In my original code I fill a datatable with the content o...

Execute component code just before or after Form_Load event in .NET WinForms?

I have a component that is in conflict with another component that handles some internal translations. What happens is that business logic components gets executed, then the translation system executes, which picks up texts now present in the form, and attempts to translate them. The problem is that the text now contains things like nu...