<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/c-sharp/tags/forms</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 01:19:05 GMT</pubDate>
<item>
<title>(C#) setLanguage in WinForms - Winkyboy</title>
<link>http://snipplr.com/view/68111/setlanguage-in-winforms/</link>
<description><![CDATA[ <p>Just a snippet I like; this can be called on GotFocus or LostFocus of a field, and it *attempts* to set the input language to the desired language.</p> ]]></description>
<pubDate>Tue, 06 Nov 2012 06:57:10 GMT</pubDate>
<guid>http://snipplr.com/view/68111/setlanguage-in-winforms/</guid>
</item>
<item>
<title>(C#) WCF Configuration using TransportWithMessageLevel Credential and Forms Authentication - amos24c</title>
<link>http://snipplr.com/view/59452/wcf-configuration-using-transportwithmessagelevel-credential-and-forms-authentication/</link>
<description><![CDATA[ <p>this thing is a pain to configure</p> ]]></description>
<pubDate>Thu, 06 Oct 2011 04:21:59 GMT</pubDate>
<guid>http://snipplr.com/view/59452/wcf-configuration-using-transportwithmessagelevel-credential-and-forms-authentication/</guid>
</item>
<item>
<title>(C#) Windows Forms Keyboard Shortcut on Control - Currysuechtig</title>
<link>http://snipplr.com/view/57156/windows-forms-keyboard-shortcut-on-control/</link>
<description><![CDATA[ <p>Easily create Windows Forms Shortcuts with this class.

For example: A shortcut to catch pasting via Ctrl + V.
Shortcut sc = new Shortcut(this, new Action(() => MessageBox.Show("Data pasted!")));
sc.Keys.Add(Keys.ControlKey);
sc.Keys.Add(Keys.V);</p> ]]></description>
<pubDate>Tue, 26 Jul 2011 21:43:49 GMT</pubDate>
<guid>http://snipplr.com/view/57156/windows-forms-keyboard-shortcut-on-control/</guid>
</item>
<item>
<title>(C#) Transfer data between forms - hairajeshk</title>
<link>http://snipplr.com/view/46155/transfer-data-between-forms/</link>
<description><![CDATA[ <p>http://www.vbdotnetheaven.com/UploadFile/thiagu304/passdata12262006073406AM/passdata.aspx</p> ]]></description>
<pubDate>Mon, 27 Dec 2010 18:00:00 GMT</pubDate>
<guid>http://snipplr.com/view/46155/transfer-data-between-forms/</guid>
</item>
<item>
<title>(C#) System.Windows.Forms.Timer Example - rtipton</title>
<link>http://snipplr.com/view/22250/systemwindowsformstimer-example/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 31 Oct 2009 22:38:30 GMT</pubDate>
<guid>http://snipplr.com/view/22250/systemwindowsformstimer-example/</guid>
</item>
<item>
<title>(C#) How to tell what form control a context menu was over when you clicked one of its items - pckujawa</title>
<link>http://snipplr.com/view/9460/how-to-tell-what-form-control-a-context-menu-was-over-when-you-clicked-one-of-its-items/</link>
<description><![CDATA[ <p>If you add a ContextMenuStrip (the menu that shows up when you right-click on something) to your design, you can conveniently have more than one form control use that context menu. The only problem is that you don't know which control the context menu was over (in other words, what data the user right-clicked on) when you get the event for one of the ToolStripMenuItems on the ContextMenuStrip being clicked. Many others have monitored the control for mouse click events to tell which control fired the event, but I've found a better, more abstract way of determining this information.

In my case, I have two DataGridViews with the same context menu. The only items on that menu are Copy and Paste. The code below shows that, when Copy is clicked, the "sender" argument can be cast as a ToolStripDropDownItem, the Owner of which is a ContextMenuStrip. This Owner can be cast as the control which holds the data that the user clicked on, e.g. a DataGridView as in my case. From that point, the control can be manipulated in any way necessary.

I still haven't found a good way to have right-click select the item (cell, row, column, table) in the DGV as if the user left-clicked. Currently, the user needs to select the data with left-clicks and then right-click inside the DGV for the context-menu to know what data to use.</p> ]]></description>
<pubDate>Mon, 03 Nov 2008 14:00:47 GMT</pubDate>
<guid>http://snipplr.com/view/9460/how-to-tell-what-form-control-a-context-menu-was-over-when-you-clicked-one-of-its-items/</guid>
</item>
<item>
<title>(C#) Basic Multithreaded Code - rengber</title>
<link>http://snipplr.com/view/2139/basic-multithreaded-code/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 07 Feb 2007 17:49:30 GMT</pubDate>
<guid>http://snipplr.com/view/2139/basic-multithreaded-code/</guid>
</item>
<item>
<title>(C#) Display a ToolTip for a DataGrid Cell - rengber</title>
<link>http://snipplr.com/view/2132/display-a-tooltip-for-a-datagrid-cell/</link>
<description><![CDATA[ <p>Weird issue with Intellisense and the HitTestInfo class.  Just type it in, it will compile.</p> ]]></description>
<pubDate>Tue, 06 Feb 2007 18:16:15 GMT</pubDate>
<guid>http://snipplr.com/view/2132/display-a-tooltip-for-a-datagrid-cell/</guid>
</item>
</channel>
</rss>