Skip to content

Commit 49d3245

Browse files
committed
Add sample for clipboard
1 parent 51866a4 commit 49d3245

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

samples/SampleWindowsForms/SecondaryForm.Designer.cs

Lines changed: 29 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/SampleWindowsForms/SecondaryForm.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,18 @@ private void buttonLoadFromFile_Click(object sender, System.EventArgs e)
3030
pictureBox1.ImageLocation = Path.Combine(AppContext.BaseDirectory, "SimpleImage.bmp");
3131
pictureBox1.LoadAsync();
3232
}
33+
34+
private void btnPutClipboard_Click(object sender, EventArgs e)
35+
{
36+
Clipboard.SetText("Some text");
37+
}
38+
39+
private void btnCheckClipboard_Click(object sender, EventArgs e)
40+
{
41+
if (Clipboard.ContainsText())
42+
{
43+
MessageBox.Show("Clipboard currently contains text");
44+
}
45+
}
3346
}
3447
}

samples/SampleWindowsForms/SecondaryForm.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
6161
<value>17, 17</value>
6262
</metadata>
63-
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
64-
<value>17, 17</value>
65-
</metadata>
6663
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
6764
<value>114, 17</value>
6865
</metadata>

0 commit comments

Comments
 (0)