winforms

Adding a Component from the Data Sources View in Visual Studio on a Form with a Custom Designer

Hello guys, I have developed a custom Designer (by inheriting from DocumentDesigner and reflecting the code found in the FormDocumentDesigner class so that I do not brake the default Form design time features) class for my forms. I associate the designer with my forms by using the Designer attribute the following way: [Designer(typeof(...

Data confusion - Selecting data in one DataGridView based on selection in another

This probably isn't the best way to do what I want, but I can't think of anything else to try... NB: I'm using Visual Basic.NET My form has 2 DataGridView controls. One of these is bound to a DataSet, the other isn't visible - at least not until the user selects a uniqueidentifier cell in the 1st grid. When the user makes this selecti...

C# WinForms BindingList & DataGridView - disallowing EDIT prevents creation of a NEW row? How can I address this?

Hi, Regarding my use of a DataGridView with BindingList, I was to disable editing current rows, but allow adding new rows. The issue I have is that when I disallows edits, this seems to prevent one from adding a new row item, as when you table into the cell for this new row it does not seem to allow editing??? Know how to get around t...

Globalize an existing Windows Forms application?

Hi, I have an existing winforms application developed using VS 2005 and .net framework 2.0. Now we need to globalize this application. The two locales are German and Japanese. I know we can use form's localize property to create localized form resources and can have other resource files for strings used in message boxes, exceptions et...

Index out of bounds of array error when parsing font string?

hello all, i keep getting an "Index is out of bounds of array" error on line # 574 which is: label.Font = new Font(fontNameFields[0], Single.Parse(fontNameFields[1])); ... The following text file i am parsing contains this exact information: Label "hi tyler" 23, 76 Arial,12.5 ...I can successfully parse all the other info (just not...

Mnemonic not showing on a System.Windows.Forms.ContextMenu

I'm having some problems with Mnemonics and ContextMenus - although the Mnemonic property of the Menutem is set correctly the little underline wont show under the relevant key. Here is my code: private void Form1_MouseDown(object sender, MouseEventArgs e) { System.Windows.Forms.ContextMenu menu = new ContextMenu(); menu.MenuItem...

Sending Linq to SQL classes over webservice

I have a windows application and a web service. Both have a Linq to SQL mapper with Customer table on them. Same table from the same database, same everything. I tried to send winapp.Customer object to web service but the webserviceReference.MyMethod() accepts webservice.Customer object and doesn't accept winapp.Customer as parameter. Tr...

Drawing vertically stacked text in WinForms

Preferably using a Graphics object, how do you draw a string so that the characters are still oriented normally, but are stacked vertically? Hopefully this rough picture conveys what I mean: ...

How to Change the productname of clickonce deployment after first install?

We have an application on pilot implementation using clickonce to deliver fast updates. We have even automated the build proces with nant and we can control every step of the building of the deploy package. This pilot, we delivered with the productname "PRODUCT TITLE (PILOT)", but now, we want to upgrade all our pilot users to the produ...

How to create collapsible panels as custom controls in WInforms?

The closest I can think of using is the GroupBox control which has a custom drawing at the top identifying the panel. Is it doable? I have done independent custom controls like buttons, sliders, color pickers, but not totally sure if this sort of drawing can be done on a GroupBox? I would need the grouping of a GroupBox or a TabPanel. ...

How Can I open a Winform Dialog when closing another?

I have a Dialog with showing some information about an object. I want to close this Dialog to show the same dialog but now with the object's sibling. It is a complex dialog that loads different components depending on the object assigned, I cant just change the reference to another object I tried launching the new one in the Closed eve...

How to store sets of controls in an assembly?

I have sets of controls contained in individual GroupBox controls. So say GroupBoxCommon contains Common UI Items, GroupBoxSpecific contains Specific UI items, etc. I have a way of stacking them in a single UI (floating panel) based on the current selection in the app. I am just wondering how I should store these sets of controls? Sho...

How to submit bugs to BugTracker.NET from C# application?

Reading the documentation page of BugTracker.NET BugTracker.NET API Documentation I realized that I need to use GET or POST which, I have to admit, I'm not very good at. I was wondering: Is there a library that could be used to easily submit bugs to BugTracker.NET from a C# application (or VB.NET) ? Or, If there's no library. How ca...

Is it possible to create a windows form app that can run from the command line with parameters?

I would like a windows form app that will contain a UI, but I want it to run from the command line with some parameters possibly also a /hide or /visible=false option. How is it possible to read in the command line parameters? And adjust accordingly? ...

Is there an post Drag and Drop event?

I'm trying to implement drag and drop capability into a custom data grid control. In the end, I'd like to be able to drag rows between 2 of these custom data grids. I believe I have everything working as expected. However, I need to do some cleanup in the drag and drop source control. Specifically, I need to refresh the grids after i...

WinForm and mixed COM Objects: STA/MTA

I'm trying to build a WinForm application with two COM Objects. However, one of the objects only works when using [MTAThread] and the other only works with [STAThread]. What would the recommended solution be? ...

How to set the default value of Colors in a custom control in Winforms?

I got the value to show up correctly using: [DefaultValue ( typeof ( Color ), "255, 0, 0" )] public Color LineColor { get { return lineColor; } set { lineColor = value; Invalidate ( ); } } But after I reload the project the control is used, this value is set to White, which I can invoke Reset to get back to Red again, but I do...

"Method xxx can not be reflected" error in webservice call

Before obfuscation, the call to the webservice works like a charm. After obfuscation i get this error. Method obfuscatedText.GetStringFromWebService can not be reflected. There was an error reflecting ". What could i do? Why do i get this error after obfuscation? ...

Insert Icon in picturebox

I need to add icon of any file I selected during run time. I have project which provide with button (when press will open dialog allowing you to select which file you need it) when user select the file (AutoCad , MS Office , etc) I need my project to read belong icon of this file and insert this icon in picturebox.. Same one tell me y...

How to change the size of the child controls in a composite control in winforms?

I basically created 2 child controls and I want to set their width to be equal to the width of the parent composite control. The problem is when I do this using the parent.Size property, it doesn't work. It only works once when you add the control. Am I supposed to override an event not a property? I thought the property change would be...