This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void button1_Click(object sender, System.EventArgs e) { | |
// Takes the selected text from a text box and puts it on the clipboard. | |
if(textBox1.SelectedText != "") | |
Clipboard.SetDataObject(textBox1.SelectedText); | |
else | |
textBox2.Text = "No text selected in textBox1"; | |
} | |
private void button2_Click(object sender, System.EventArgs e) { | |
// Declares an IDataObject to hold the data returned from the clipboard. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script> | |
function getSelectionText() { | |
var text = ""; | |
if (window.getSelection) { | |
text = window.getSelection().toString(); | |
} else if (document.selection && document.selection.type != "Control") { | |
text = document.selection.createRange().text; | |
} | |
return text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- For ease i'm just using a JQuery version hosted by JQuery- you can download any version and link to it locally --> | |
<script src="http://code.jquery.com/jquery-latest.js"></script> | |
<script> | |
$(document).ready(function() { | |
var refreshId = setInterval(function() { | |
location.reload(); | |
}, 1000); | |
$.ajaxSetup({ cache: false }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>My Gists</h1> | |
<ul id="list"></ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices | |
public const int TVIF_STATE = 0x8; | |
public const int TVIS_STATEIMAGEMASK = 0xF000; | |
public const int TV_FIRST= 0x1100; | |
public const int TVM_SETITEM = TV_FIRST + 63; | |
public struct TVITEM | |
{ | |
public int mask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var dictionary = new Dictionary<string, int>() | |
{ | |
{"1", 1}, {"2", 2}, {"3", 3} | |
}; | |
string[] keyArray = new string[dictionary.Keys.Count]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Download the ObjectListView project | |
* Add the ObjectListView project to your project (right click on your solution; choose “Add...”, “Existing Project”, then choose the ObjectListView.csproj) | |
* In your project, add a reference to the ObjectListView project (right click on your project; choose “Add Reference...”, choose “Projects” tab; then double click on the ObjectListView project) | |
* there should now be a new section in your Toolbox, “ObjectListView Components”. In that section should be ObjectListView and its friends. (If you are using SharpDevelop, the section is called “Custom Components” and it appears at the bottom of the toolbox.) You can then drag an ObjectListView onto your window, and use it as you would a standard ListView control. | |
* add reference to your code | |
using System.Collections; | |
using BrightIdeasSoftware; | |
* sample code | |
// let the OLV know that a person node can expand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM ... WHERE name = 'someone' COLLATE NOCASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set auto will reorder the sub item,So don't set the width of column as auto. | |
You can set the column width as a fixed width, like column.width=120 . |
OlderNewer