public partial class Form1 : Form
{
public static string a = "a"; public static string b = "b"; public static string c = "c";
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = a;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = b;
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = c;
}
private void button4_Click(object sender, EventArgs e)
{
a = null;
b = null;
c = null;
}
}
我想爲聊天做一個簡單的鍵盤。
我用一個只有3個按鈕的小樣本程序啓動它;按鈕a,按鈕b,按鈕c分別用於a,b,c。
當我運行程序時,我按了按鈕a &,然後按b按鈕b(現在我想輸出ab形式),但它首先顯示一個然後按按鈕b它刪除a並顯示b。
我想製作更多按鈕來製作鍵盤。 基本上,我想打印存儲在順序按鍵的字母,但刪除了第一個,然後打印下一個..如何使按鈕輸入特定值?
向我們顯示代碼。你還在開發什麼類型的應用程序? WPF,UWP,Windows Phone?我的猜測是你沒有將字符'b'連接到輸出字符串 – dimlucas
什麼?也就是說,如果你設置了文字。你至少需要管理文本(追加等)... – icbytes
dimlucas先生!我正在使用Visual Studio C#(Windows窗體應用程序) 我試圖上傳圖像或代碼 –