winforms

How to use JpegBitmapDecoder in Systems.Windows.Forms.UserControl

Is there a way that I can use the BitmapFrame returned from JpegBitmapDecoder in the UserControl.OnPaint() method? I was told that the performance of JPEG decoding from Systems.Windows.Media.Imaging is much better than the one in GDI+ used by Systems.Windows.Forms library. However, my application is written with Systems.Windows.Forms l...

Why the form class in windows form application is declared as partial?

Can somebody tell why and for what it is declared as partial? what is its use? Is this possible to declare it without partial? ...

Multilingual TextBox-Winforms C#

I need to display Korean and Arabic characters in TextBox. Following code is working fine for Arabic but not for Korean. Any sugeestion will be helpful? private void PrintArabicAndKorean() { char aleph; char ra; char dal; char wao; char korean; string wor...

Vector Graphics in C# WinForms - should I interoperate with WPF?

I have a video camera that I'm interfacing with a C# app. The camera actually comes with a .NET WinForms control. It supports drawing on it with GDI+ functions. When I zoom in, I need <1 pixel accuracy i.e. I want to draw a circle with a radius of less than two pixels. How can I draw vector graphics in WinForms? Is my best bet to over...

When drawing an image: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI

Hi, I've got a global Graphics object created from a Panel. At regular intervals an image is picked up from the disk and drawn into the panel using Graphics.DrawImage(). It works fine for a few iterations and then I'm getting the following helpful exception: System.Runtime.InteropServices.ExternalException: A generic error occurred in ...

C# and .NET: TextBox.Text is not always actual?

Hello. As always, i'm forced to use technologies i'm not familiar with :(. For now it is .NET framework with by C#. It is a simple GUI application with some text fields and the almighty TextBox with the 'Text' property. It seems that the content of this 'Text' property is not always actual O_O. For example, if i change text and click ...

How should I set up a user control to fire events of its children as if they were its own?

In other words, I have a UserControl that has, for example, a label on it. Well, when the client registers with the MouseMove event of the UserControl, it should get that event whether the mouse is over the label or somewhere else on the UserControl. What would be the best way to set this up? C# ...

How to extract XML from the WinForms WebBrowser control?

I want the same as WebBrowser.Document.Body.InnerHtml, but as an XML representation. ...

C sharp question - make form visible

Hey I made 2 forms in c sharp visual studio. How can I make one form invisible and another visible (Have done this in visual basic only before) I guess Syntax should be similar. ...

Winforms RichTextBox: How can I scroll the caret to the middle of the RichTextBox?

I want to scroll a RichTextBox so that the caret is approximately in the middle of the RichTextBox. Something like RichTextBox.ScrollToCaret(), except I don't want to put the caret at the very top. I saw Winforms: Screen Location of Caret Position, and of course also saw the Win32 function SetCaretPos(). But I'm not sure how to tra...

Winforms RichTextBox: How can I determine how many lines of text are visible?

I have a Winforms app containing a RichTextBox. How can I determine how many lines of text are displayed, currently visible? Reason: I want to scroll the caret to the middle of the RichTextBox. I can use RichTextBox.ScrollToCaret(), but that puts the caret at the top of the RichTextBox. I figure, If I know how many lines are dis...

How do I lock down a windows programs with Usernames and passwords?

I am developing a program that uses a view to display information. Usernames and other valuable information. How do I set it so that at the first run of the program brings it to a different form to input a new password? The user has never logged in before. Then the second run of the program prompt for that password. Ideally the solu...

Icons in a DataGridViewComboBoxColumn

I have a DataGridViewComboBoxColumn in my application that is defined as follows DataGridViewComboBoxColumn TransferActionCol = new DataGridViewComboBoxColumn(); TransferActionCol.DataSource = Enum.GetValues(typeof(TransferActionEnum)); TransferActionCol.DataPropertyName = "TransferAction"; TransferActionCol.Name = "Transfer Action"; Tr...

FormName.Show won't work

When I try to show a form, I have to use ShowDialog instead of Show. (This is causing problems later in my code.) When I use show, the form pops up for a second and then the program closes. (VB.Net 2003) ...

How to force a certain UserControl design

I am writing a Base UserControl, that will be inherited by a bunch of other UserControls. I need to enforce a certain design for all these descendant controls (e.g. a couple of buttons must be on the top along with a label or two). The rest of the descendant UserControl area is free to have whatever on it. Initially, I thought that ...

WinForms designer: generated code for a custom Collection<T> property

Hi, I have a control with a property that is inherited from the Collection type: public class MyCoolCollection : Collection<SomeType> { private string m_TestString; public string TestString { get { return m_TestString; } set { m_TestString = value; } } } and when I drop this control o...

wake up a service, communication with services.

Hi to all. Some time ago i Wrote a service with a timer that make an action every n minutes. All was right. But now, I want to write a service that waits for a signal, message or something from a gui application for doing his job. I want me process to sleep pacefull (not in a infinite loop sniffing something) until my winforms applicat...

TextBox on a form is acting weird.

I had a main form. I created a child form that is instantiated by this parent form. I have some textbox, buttons and a progress bar on that child form. When I create that form and show it, the textbox's in that form (child) becomes kind of transparent. When I click on them to write something, my child form becomes inactive and the window...

ComboBox AutoComplete Custom Capabilities

How can I extend the AutoComplete feature of a WinForm ComboBox to, for example, find matches of items using a regular expression or for simplicity to find items that contains the text entered? ...

WPF Images - Trying use to use treeview, but can't get background to be clear

Greetings, I have a TreeView containing a set of TreeViewItems - Each TreeView is pretty simple (just some text, plus an image) - The images are usually folder & files icon. All good and simple...except for the fact that since the contents of images do not fit an exact square, there is some white background surrounding portions of each....