winforms

Loading controls from xml file

hi all, I know how to write to xml files, but I'm having trouble doing what I need to do and can't find adequate info on this type of problem. Here's one xml file below: <?xml version="1.0" encoding="utf-8"?> <controls> <Label Content="Double-click to edit." Location="258, 178" Size="101, 13" ForeColor="-1" /> <LinkLabel Con...

How do you jump to a particular row in a DataGridView by typing (a la Windows Explorer details view)

I have a .NET Winforms app in C# with a DataGridView that's read-only and populated with some number of rows. I'd like to have functionality similar to Windows Explorer's (and many other applications) details view for example. I'd like the DataGridView to behave such that when it has focus if you start typing, the current row selection ...

c# Set the Parent of a form

I have a Windows form from which I would like to open a status form that says "Saving..." and then disapears when the saving is complete. I would like to center this small status form in the middle of the calling form. I've tried setting the "StartPosition" propery to "CenterParent", but it doest work. I create the status form from the o...

aspNetCompatibility WCF and WinForm

I would like to use Windows Forms with a WCF service and leverage the pre-built authentication of asp.net by using aspNetCompatibilityEnabled = true in the WCF service. Is there any module or pre-built assemblies that can add ASP.NET functionality to a Windows Forms application? As far as I understand, this functionality isn't built int...

Reading and Processing XML File.

Hello, I have an Xml file. It's format is as follows: ControlType > Content > LocationX > LocationY > ForeColor/LinkColor > Int > Int > Int > Int File example: <?xml version="1.0" encoding="utf-8"?> <cs> <Label Content="Double-click to edit." LocationX="583" LocationY="254" A="255" R="255" G="255" B="255" /> <LinkLabel Content="...

current line number changed event if vb.net

How can I do some code when the user changes what line the caret is on? so something like: sub textbox1_lineindexchanged (byval ....) Handles Textbox1.Lineindexchanged 'do code based on the current line end sub sorry, I am using a richtextbox, just I always used it so I just call it a textbox in my thoguhts. ...

Is there a better way to store a list of strings in an applications config file than using a StringCollection?

I have a list of filenames I need to store in my applications config file. The only collection that comes up in the initial combo box on the settings page is System.Collections.Specialized.StringCollection. Now initially I didn't query this as I converted this to a List<string> straight away. There was one piece of code I wasn't happy w...

Unusual Font Conversion

Hi All, I have the following string in a file, and it needs to be converted back to a Font object. But I'm not sure how to do this one: font string: [Font: Name=Segoe UI, Size=14, Units=3, GdiCharSet=1, GdiVerticalFont=False] I appreciate any help at all, thank you bael ...

How to stop a .NET application from loading if certain criteria aren't met

I need certain criteria to be met, a particular folder needs to be present on the c drive, before this app should load. How, during the load process, can I stop/quit the application. I already have ascertained if the folder exists. In old VB projects you would just use 'Unload Me' but that isn't in C#. I tried Application.Exit() but t...

DataGridView and dataset best practice frustration

Im using c# 2008 winforms. Ive found it very frustrating trying to find the best practice way to use datasets and datagridviews in winforms apps in general to achieve the results i want. Basically i want to (and this is the generic methodology i want to use in all my applications) 1. populate a dataset from a sql table 2. populate a da...

how to save win form as image/pdf?

HI All, I do have a win form, its something like a ticket machine. i have one page where i will be getting all the user information and then click of a button called Generate Bill will show a winform with some image as ht background(say company logo name etc.) with label controls placed in position which will display the information from...

Displaying a pdf file from Winform.

I'm just creating a simple calculator in C# (windows form) I've created a "User Help" which is a pdf file, what I want is to display that pdf file if the user clicks on the "Help" button in the WinForm. If assumed that Adobe reader is pre-installed on the user's machine.... How to open the pdf file on button click in winForm? I don't p...

UserControl Load event not fired

Hi I have WinForms application. My Form derived class has UserControl derived class. I simply put several controls into one UserControl to simplify reuse. The Load event of UserControl is not fired. Do I have to set some property? ...

how set scroll bar maximum property in Tablelayoutpanel

In TableLayoutPanel, I ve 4 column, in 2 column I set two user controls like dockble, if i dock the 2nd usercontrol after the 1st control, the scroll bar(Auto scroll is true on tablelayoutpanel) contiously decreased.How i set this normally. ...

DataGridViewColumn.DataPropertyName Property

Hi I have a DataGridView control and I want to populate it with data. I use DataSource property // dgvDealAsset is DataGridView private void DealAssetListControl_Load(object sender, EventArgs e) { dgvDealAssets.AutoGenerateColumns = false; dgvDealAssets.DataSource = DealAssetList.Instance.Values...

how to hide the previous form when the present form is being loaded

In C sharp win forms, not using MDI, m creating multiple forms i wish to hide the previous form while loading a new form on a button's click i write the following code to achieve the purpose but the previous form still remains visible, kindly help!! here's the code... private void btnEmployee_Click(object sender, EventArgs e) { Fo...

Feature tracking WinForms

Hi, I would like to extend my WinForms app, which a feature that allows me to monitor which functions are used by the users. The idea is to count how many times e.g. a button has been clicked, or a popup was opened. I want to know which features are used more or less often by the users. Any ideas how this can be done? (Or even if some...

How do I ensure my winform application deployment overwrites old versions.

I have created a msi install package for my project from the VS2008 deployment project. but I am having problems when it comes to upgrading installs, The previously installed version does not get overwritten. How do I ensure that previously installed versions get overwritten? ...

Why is this getter throwing StackOverflowException, but only when called from one project?

I have a few projects: A database interface project that defines Thingo (main solution) A logic project that defines ThingoChooser (plugin solution) A GUI project that refers to the logic project (plugin solution A test project that refers to the logic project (plugin solution) I'm debugging the plugin, so I run the main solution wit...

RemoveHandlers on the base form

I wonder if I can remove all added event handlers in all the child forms from the one base form in the Closing method. (VB.NET; .NET 2.0) Background: In a project I analyze a memory problem. I verified with the memory profile (see related question) and find out that some forms are not collected by the GC, probably because of the EventH...