winforms

Editing business objects in Winforms DataGridView

Is possible to edit properties of business object (one property, one column) binded as BindingList to Winforms DataGridView? Or do I have to use DataSet or DataTable? I'm not able to get a cell to edit mode. ...

Break point issue

I am putting a break point in a winforms application inside a function like public void FillOutListViewCtrl() { // code to be debugged } I put a breakpoint here. After running the application I just want to know what exactly is going on inside of this function. Is there any way to go to this function directly? Do I need to attach ...

How can i do conditional formatting in datgridview in C#?

In windows Application I want to Set colors of different cells in datagridview based on the value range Suppose value 1..22 : cell color should be green value 23.30 : cell color should be gray value >30 : cell color should be red how can i do it..please suggest some code snippet? How can i do conditional formatting in datgridview in C#...

TopMost window - set only if there is "higher" Z ordered window?

Hi, I want to have my form always Topmost (it follows mouse cursor), even above URL window in IE for example. That works when I add Topmost=true or BringToFront() to OnPaint method. However, everything is OK but clicking on buttons in main form (the app consists of Form1 for options and transparent form2, following the mouse). If the for...

Localize user entered content in Winforms application.

Hi We have a winforms application , which is to be globalized and localized for french and japanese . the default locale is English. I understood, how to localize my forms . but need to understand localization of user entered data in those forms. Our application creates some templates which should be used by person in different locale...

C# - ActiveX control without a form

We are required to use a 3rd party ActiveX control. The only issue is, the layer in our software is a business layer and has no access to a window or form. It also runs on separate threads (and should work from any thread) that are not STA. Rather than breaking our separation of UI from business logic, we used this workaround to make ...

Return DataTable based on boolean param

Hi All, I have a table that has a field, "IsActive," that indicates whether a record has been "deleted" or not. Currently, I retrieve this info like so: public DataTable GetContractors(bool IsActive) { SqlParameter paramIsActive = new SqlParameter("@IsActive", SqlDbType.Bit); paramIsActive.Value = IsActive; ...

Visual studio - TabControl.TabPages.Insert not working

Hi guys. A simple one. Here's my code: public MainForm() { InitializeComponent(); MyServiceSettings obj = (MyServiceSettings)ConfigurationManager.GetSection("MyServiceSettings"); foreach (MyServiceConfigElement service in obj.Services) CreateServiceControl(service); } private void ...

How to Bind List<> to ComboBox ?

hi I have this code : public static List<string> MyTable = new List<string>(); dsView = new DataSet(); adp = new SqlCeDataAdapter("SELECT DISTINCT Fname FROM MEN", Conn); adp.Fill(dsView, "MEN"); adp.Dispose(); foreach (DataRow R in dsView.Tables["MEN"].Rows) GG.Add( R["Fname"].ToString()); how to Bind it to ComboBox ? tha...

SplitContainer & TableLayoutPanel auto sizing problem

I am currently programming my first Windows Forms application using C#. I'm using a TableLayoutPanel that will have a fixed 1X3 table [ 1 | 2 | 3 ], with each cell containing a flow panel that flows top to bottom. I have the row resizing option of the single row in the TableLayoutPanel set to autosize because I want the TableLayoutPanel ...

Transparency in composite controls?

I have a composite control that is includes a groupbox control. The problem is it covers the controls that are placed on top of this composite control. Even though I send the new controls to top, so they should be visible, but they aren't. When I just use the groupbox, of course it shows through things so you see the included controls, ...

How to add all controls of another form to a form in Winforms?

I tried using: CoolForm.ActiveForm.Controls but the count returns 0. The main form that is shown is AppForm and has all the controls. I want to add all the controls of CoolForm (which has 1 form) to be added to the main form (AppForm) Is this possible? ...

DataGridViewRow not being Garbage Collected

I have a DataGridView being regularly populated via data-bound objects, and the number of rows can potentially become large, say many thousands during a 'logging cycle'. When a new 'logging cycle' begins, the grid is cleared because the underlying datasource is cleared and the process begins again. This is all fine, but because the pre...

Active form in a Windows application?

I am developing a Windows Forms application. I have four forms which is inherited from Baseform in another project. In all four forms I am using a label to show some transaction count based on network status. I have implemented a thread which gets the active form of application and setting up the text. The code works fine if application ...

How to force a ListBox to reload data in WinForm

I have a ListBox on a Windows Form that is populated during the Form_Load event like so. private void Form1_Load(object sender, EventArgs e) { SA.Business.ComputerList computerList; computerList = SA.Business.Business.GetComputerList(); this.lbComputers.DataSource = computerList; this.lbComp...

Keystroke combinations in c# winforms app

Hi, does anyone know how i can setup an event handler so that if the keystrokes Alt + Shift + Ctrl + a letter will do something? ...

How to minimize form from a click on a webbrowser control.

I've got a winform with a webbrowser control. The URL is a web page containing a java applet showing my web cam. What I'd like to do is minimize the form when I click anywhere in the region of the webbrowser control / webcam image. I tried messing around with transparent buttons but could not get anything to work. Since there is no OnCli...

How do I listen for a keyboard combination globally?

How would I have my C# program listen for a specific keyboard combination (say, CTRL+ALT+F2) globally. Even if my application is minimized I would want it to intercept this and do something. ...

VB.NET Browser Auto Refresh

Hi, I want to make a program in Visual Studio 2008 in Visual Basic. It involves a web browser and I want to make it auto refresh and allow people to choose the time period in which they want to auto refresh. It won't take user input but I have checkboxes that are preset. I think this may be possible using a timer and the WebBrowser1.Ref...

iPhone UI controls for WinForms

Does anybody know where I could find WinForms controls that mimic those on the iPhone? I am interested in doing some iPhone prototyping using Visual Studio and it would be handy if I could make the controls look like the native iPhone controls. I know that I could just use Interface Builder on a Mac, but I do not want to do this. I just...