winforms

Programmatically Adding Labels To Newly Created Row?

I'm adding rows in the following manner: Table.RowCount = Table.RowCount ++; Table.RowStyles.Add(new RowStyle(System.Windows.Forms.SizeType.AutoSize)); How can I add a Label to each cell in this newly created row? ...

how I can show the sum of in a datagridview column?

I need to show the sum of the count column from this datagridview, but I don't know how I can get to the data in the datagridview. When I click on the button, I want to show 94 in label1. How can this be done? ...

How do I mimic the excel "insert Comment" in datagridview

I admire the excel "insert comments" cell option. I would like to reproduce this in my datagridview in .net 2.0 using c#. Could somebody give me an idea as to the approch I should take on creating the edit box. Thanks c# winforms, .net 2.0 ...

how to print "Hello World" to Default printer

hi how to print "Hello World" to Default printer ? without crystalReport in Winform C# program thank's in advance ...

csv contents of webbrowser control

A webbrowser control winds up at a csv document, cannot download it without additional step I don't want to take. So I'm trying to access the contents loaded into the webbrowser and get the csv data without downloading the file. The webbrowser.document, being an htmldocument, is null. the webbrowser.activexinstance.document (and docume...

C# Winform Impersonation fail to work

Hello I just spent 2 days reading a bunch of stuff about impersonation in C# (including stackoverflow and codeproject articles) and here is the result of my investigations. To make it short, I just want to start and stop a service from a winform application running under standard (non privileged) user account. I want to impersonate my ...

C#/WinForms: how to prevent font changing based on OS language

I have written a WinForms program in C# and left the default font for all form controls (labels, checkboxes...) (The font is Tahoma I think, not sure though). When I compile the program and then run it on a Japanese language computer, all the fonts switch to "MS UI Gothic" (a Japanese font). Is there anyway I can force the font to be th...

How to draw rounded raised and sunken edges of control?

I need a way to draw rounded raised and sunken corner edges on a custom control. Currently, I am using ControlPaint.DrawBorder3D, but of course the corners are squared off and looks terrible. How can this be done? Also, this project is not allowed to use any PInvoke calls. ...

How do you get a different Context Menu if you Lt-Click or Rt-Click on a notify icon?

I have a application that is based out of the system tray. I have a nice context menu if you right click on it however I would like a different context menu to show up if you left click on it. Right now I make the different menu show up with private void niTrayIcon_MouseClick(object sender, MouseEventArgs e) { if (e.Button == Syste...

When the UI thread is sleeping, can invoke methods from background threads block indefinitely?

When I call Thread.Sleep on the UI thread, does all invoke methods from background thread automatically get queued up in the message pump of the UI thread and processed when it eventually wakes up? I'm having problems with a winform app that uses a lot of threadpool threads and sometimes the app hangs after locking/unlocking Windows. On...

Validating with errorProvider using dropdownlist in Windows Forms?

So basically I am trying to validate my drop down list (combobox) using the Validating event. This works, but calls the focus to my drop down list, not allowing a selection to be made. Is there any way to get the errorProvider working with dropdownlist if (ddlTypeOfPass.SelectedIndex < 1) { errorProvider1....

How to allow user to move a control on the form

I have a winform on which i want to allow the user to move a control. The control is (for now) a vertical line : label with border and a width of 1. The context is not very important but i'll give it to you anyways. I have a background with some graphics and i'd like the user to be able to slide a guideline above the graphics. The gr...

Import Excel to datatable

Hello, I am using syncfusion to import excel to datattable.when the datat is imported to datatable the columns are all strings .how to convert these columns to specific datatype?how do i validate the column data type? using Syncfusion.XlsIO; private void btnImport_Click(object sender, EventArgs e) { ImportExcelFile...

C# WinForm PropertyGrid - Adding a linklabel in DescriptionAttribute?

Perhaps I'm just searching with the wrong terms, but I can't find any information about this. I'd like to be able to add a link to a pdf file (or help file?) within a property descriptor for a given object property. I'm fairly certain this is supported functionality (I swear I've seen it before) but I can't find any information about h...

Can a Winforms app unlock/replace its own exe file for auto-update?

I'm trying to create an auto-updating app using Winforms. I can't use click-once or the updater block because the app needs to run on Mono also. Once I download the new exe file from a webservice, is it possible to unlock the running exe file, replace it, and restart the app? ...

Add text bullets to a C# form

I am creating a form in C# and need to display text on the form. I need some of the text to show up in a bulleted, unordered list. Is it possible to do this while using a label? Or a rich text box? I am not using ASP.NET and this is for a desktop app. My message should look like this: To continue please selected one of the actions belo...

Component library to create embedded Windows GUI like Visual Studio ?

Is there a component library (free or commercial) to do so ? I don't want to develop a programmers editor so Visual Studio Shell won't fit I think, I just want the GUI Window system alone for example for drawing charts with panels on the left to configure the charts. I'm beginner so I prefer something that is well documented. ...

"Close" button on child WebBrowser window closes an parent one(.NET, winforms)

Hello! I'm using WebBrowser control to allow user navigate to intranet web-portal and keep user in c# desktop application. In some cases user can clicks on link on html-page and child window with WebBrowser control opens(to do that, I subscribed to NewWindow event on parent WebBrowser control). There is "Close" button on child window's p...

.NET WinForms Custom Control: how to get a reference to the containing form

Is there a way, when creating a WinForms Custom Control/User Control, to get a reference at runtime to the form the control is placed on, so as to access various properties of that form? I would rather not pass a reference to the form into the constructor of the control, as, for various reasons, I need to keep a default constructor with ...

AccessViolationException - Trying to print

Hi All, I am trying to print a report from Reporting Services, the approach I am taking is: Render the report to get the Byte[] Create a file in the client (Something.pdf) Load that file in Read Mode to a FileStream Then I try to make a call to the procedures described in http://support.microsoft.com/kb/322091/en-us If you in method S...