winforms

How can I progmatically click a link in a Winform Web Browser control?

I would like to know how to programatically click a link from with in a Winform Web Browser control. foreach (HtmlElement linkElement in webBrowser.Document.GetElementsByTagName("A")) { if(linkElement.InnerText == "Helpful Tips") { //Click Functionality } ...

Application's shortcut keys "swallowed" by child components

In my main application Form I have a number of menu and toolbar button functions to which I have assigned shortcut keys such as F10, F11 and F12. The shortcuts work well except for instances where certain controls have focus, such as a 3rd-party grid control. In that case the F11 or other shortcuts are handled by that control and swallow...

How to get find the CDN redirect to a Flash video file from a given URL?

The goal is to make a Windows forms application that retrieves a video's URL from a page. Consider this URL: http://lads.myspace.com/videos/c.swf?t=1&sfs=1&nl=1&mega=megavideo.com&m=52621289 I want to embed it in a player but, to do that requires this URL http://l3-hl1xl.myspacecdn.cust.footprint.net/videos02/15/e95...

Change the forecolor of read-only properties in a propertygrid

I'm using a WinForms property grid to display the properties of an object. However, most of the properties are read only and thus show up as grey rather then black. Is there a way to customize the colors that are used? I'd like the disabled properties to be a bit easier to read. BTW: I think the answer to this question might be related ...

Disable copy/paste menu popup on textbox?

Using winform w/vb.net. When I have form w/a textbox and one right-clicks on the textbox a context menu pops up w/copy/paste options. How do I disable this from poping up (I want to use the right-click for my one function)? ...

In autocomplete combobox selectionindexchanged event not firing on mouse scroll

I am working on windows application, I have one form which contain combobox with autocompletemode=suggestappend and autocompletesource=listitems property.Without these property the selectionindexchanged event was used to fire on mouse scroll also but now with these property set the selectionindexchanged event is not firing on mouse scrol...

Winforms. ObjectDataSource add calculated column

Hello. I use ObjectDataSource and bind IEnumerable[Person] to my DevExpress GridView class Person { private int Id {get; set;} public string Name {get; set;} } At grid there are two columns Id,Name. I want new column "Sum", which is calculated by person object(aggragate by person). At asp.net I create new column and calculate i...

Using the selected index of a combobox in an If statement of a different form.

I'm trying to reference the selected index of a combobox on my mainform in an if statement inside a method on a second form. Some google searching has confused me a bit. The most obvious answer I can see is just making the combobox control on the mainform public, however the websites I've been reading seem to indicate that this is not th...

Editable Column headers for WinForms DataGrid Control?

Hi all, I'd like to display a DataGrid control where the column headers are editable by the user. Is this possible? ...

c#, Textbox.Text encoding

Hi! I have code: string text = sampleTextBox.Text; and I'm wondering in what encoding text is? Is it utf16 (as it is string) or maybe it is my operating system encoding? ...

Show MDI child Always on top of other MDI child

How do I show a MDIChild Form always on top of other MDIChild Forms ? I have set TopMost property of the ChildForm to True, But the form still behaves the same way... I have tried to set TopLevel property of ChildForm to True and got the error message... "Top-level Style of a Parented control cannot be changed." How do I achieve this....

How Can I Create a PDF Quotation File from Winform?

Assuming i have a winform that has a button called "Create a Quote". Once user clicks it, a PDF File gets created on desktop. The PDF File has a fixed design/structure e.g. the logo is at the top left corner, the headers are fixed, etc. However, the data it self is pulled from a database. As you see above, Quotation #, Description, Qt...

What's an efficient method of handeling tab pages dynamically with user controls in them?

I'm looking for an efficient manner in which to handle (methods and events of controls) dynamically created tab pages with dynamically created controls in them (same interface per tab page). I want to be able to identify what tab page, a button's Click event came from and such behavior. Would I be set by using a generic collection list...

.NET Tab Contol. Not scroling when chield control have a min size and anchor right.

Hi all, please help. I have a simple dialog with tab control whit property Dock = Fill. On the tab page I add another control and set its properties Anchor as 'Left, Top, Right' and min size as '600,300' for example. I set the property of tab page AutoScrolling to true. But when I resize the dialog the horizontal scrolling of the tab p...

Add character counter to MemoExEdit control

I am trying to make a character counter, 40/200...41/200 and so on. Now for a textbox control I am hooking into the KeyUp Event with something like this... public static void GetRemainingChars(MyTextBox txt, LabelControl lbl) { var maxChars = txt.Properties.MaxLength; lbl.Text = txt.Text.Length + "/" + maxChars;...

How to control a C# Program from the web? Using AJAX maybe?

Hello. Can anyone explain how to send variables from the web (PHP, Javascript, etc.) to a C# program? I want to allow the web to tell the program what to do. Maybe I could use AJAX to send data to an auto-updating page, which the C# program can then read? That would also allow users to be logged-in to the page and therefore different dat...

Unsubscribing Forms components from long-lived event sources - when?

I have a .NET 1.1. application which provides string resources through a bespoke translation system that looks a little like this: interface ITranslationProvider { string GetTranslation(string key); event LanguageChangedEvent LanguageChanged; } ie: language can change at runtime, and components need to respond by updating dis...

Window transparency in WPF vs Winforms

Why is it that I have to set the WindowStyle property to None on a WPF form to get transparency, but in Winforms I can do it on any form, and retain borders, standard buttons, etc? Clearly the API supports this, so I'm not clear on what's special about WPF that would make this an issue. I'm guessing that WPF is jumping through some Dire...

TabVisible workaround - memory leaking

I'm trying to implement enhanced TabControl/TabPage classes, in order to achieve real TabVisible feature, since TabPage's Visible property doesn't work as expected. I'm working with C# / WinForms / VS2005 / .Net FW 2.0; I've implemented the code this way: http://csharp.pastebin.com/AUnzRQLw And I've made a Form to test it, checking/un...

load event not fired in inherited user control loaded from another assembly (Winforms)

Hi, I have an application with plugin-like structure. all application forms inherit from a base UserControl : public class BaseUserControl : UserControl { // some common properties and methods // protected override void OnLoad(EventArgs e) { base.OnLoad(e); } } and are compiled in different assemblies. When I want to show a form...