winforms

Have a Form opened multiple times with different Localizations in Visual Studio

Hello, I'm developing a localizable product and Forms have the Localizable property set to True but it is difficult to me to work at the different versions of the Forms if I have to switch from on Language to another one. Is there a way to have the form opened twice (or more) with different localizations? (as they are really different f...

Copy/Paste in windows forms with custom controls

I am writing a small app in C# using windows forms. I want to let my users copy and paste data around the app and there are some custom controls, for example one is a colour picker. Some of the default controls (well at least the TextBox) have a copy and paste functionality already. I want to have the same thing with my colour picker, a...

c#, listbox, stackOverflow exception

Hi! I inherited KryptonToolkit ListBox control to get SelectedItemChanging event. public class CPListBox : KryptonListBox { public event CancelEventHandler SelectedIndexChanging; protected virtual void OnSelectedIndexChanging(CancelEventArgs e) { SelectedIndexChanging(this, e); } protected override void OnSelectedIndexChange...

.NET WinForms startup crash

Looks like that on some clients our WinForms up crashes on startup. With some I mean very very rare. In one situation we found out that the Arial systemfont was corrupt and caused the crashed in the InitializeComponents on startup. Finding that our was very hard, the only clue was an event log entry that the System.Drawing module caused ...

When trying to run exe file without its dlls, there is no error message c#

Hi I have a c# application which has a dll added by reference. when I try to run the exe file from windows (after compilation) and the dll is renamed I want the application to show an error message ; Does someone know how can I do it in code? Thanks. ...

Clickable URL in a Winform Message Box?

I want to display a link to help in a message box. By default the text is displayed as a non-selectable string. ...

How to catch on a winform when the TAB key is pressed

I developed a Grid Control and I want that when Tab is pressed it jumps from on cell ot another. The issue is that no matters what event I suscribe or I override on the control when tab is pressed it never gets called. I also try to catch the Tab at the Form level but it's the same , any Key events respond to the TAB. Any suggestions? ...

Need a faster DataGridView bulk edit method

Hello all, This is what I'm currently using to implement a "Check all" feature on a bound DataGridView: int max = ((DataTable)dataGridRes.DataSource).Rows.Count; for (int i = 0; i < max; i++) { if(((DataTable)dataGridRes.DataSource).Rows[i].Field<long>(0) == 0) ((DataTable)dataGridRes.DataSource).Rows[i].SetField(0, 1); } ...

How to call a shared member on types with different types?

I have different sets of custom Winforms controls all deriving from Control such as: CalculatorPanel, GraphPanel, DisplayPanel, etc : Control I use a single Form to display one or more of these sets depending on what the user wants to see. All of them has a member called: Input where the type is different such as: CalculatorInput...

Changing the orientation of a Win control in VB .Net

I need to allow the user to rotate a control (the control inherits from a TextBox) in 90 degree increments so the text can be read from either side, or even upside down. I'm guessing I could override the control's paint event and just paint it in the orientation that I want, but I'm just wondering if there's a quicker/built-in way? Thi...

Font linking in the registry

A few years back, I created a WinForms application that has been successfully deployed. The next version of the application must support Chinese and Korean characters. For aesthetic reasons, my client wanted all the text in the application displayed with the Arial font family. However, Arial doesn't support Chinese and Korean character...

Hosting Windows Forms controls in native windows, window class="Static"

I need to provide a Windows Forms control to a native application (Visual Studio). So I create a control and provide its handle. Then, when I check the native window using Spy++, I see that my control is wrapped in additional 'control' with window class = "Static" and title "This is a static!". I have several problems with it: Resize ...

Starting and displaying progress of multiple synchronous operations

I have a WinForms app and am trying to add the ability to start up multiple operations based on data entered in a datagridview. The operations must be run synchronously to monitor that they complete succesfully before inserting a row into the DB to indicate that the operation was succesfull. I also have a status event handler on the ope...

How do I stop WCF from message pumping while it is waiting on a synchronous call?

I have a situation where a basic message, such as wm_paint, inside it's treatment will trigger a call WCF Webservices when, for example, it needs remote formatting information. However, while WCF is waiting for that call to return, messages keep being pumped, which can end up in another message triggering the same call. -Thread safety ...

Multiple ReportViewers in application?

Hi All, I am developing a WinForms application and starting to dig into the reporting functionality. This is a smart client app, using SQL Server Compact Edition, which will be used both on and offline. From what little I have read, since this will be used offline, I will need to add a ReportViewer control to my app to display repor...

How to get properties from FieldInfo in C#?

Hello, I have this method and want to get all properties from the FieldInfos? How to get it? private static void FindFields(ICollection<FieldInfo> fields, Type t) { var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly; foreach (var field in t.G...

How to add to end of array C#?

How do I add a new item from a TextBox and Button on a Windows Form at the end of an ArrayList which references a class? private product[] value = new product[4]; value[1] = new product("One",5) value[2] = new product("Two",3) value[3] = new product("Three",8) Workflow Enter new products details into textbox1, textbox2, textbox3 W...

GridBagLayout .NET WinForms

Is there anything similar to Java Swing's GridBagLayout on .NET and Winforms? ...

C# Get Variable Value from Separate Form

How can I get the value's of variables from a separate form? ...

Is it possible to get the index (start position) for the selected text in a WebBrowser control?

I would like to get the index (start position) for the selected text in a WebBrowser control. Similar to the index you would get when doing a regular expression search. I want to get the "line and column number" of the selected text. These can be determined based on the index of the selection. I have tried using an IHTMLTxtRange in com...