c# 彈出帶返回值的對話框

1.返回字符串

winform:

屏幕寬度:Screen.PrimaryScreen.Bounds.Width;

屏幕高度:Screen.PrimaryScreen.Bounds.Height;

using Microsoft.VisualBasic;

String PM = Interaction.InputBox("請輸入密碼", "輸入密碼", "", Screen.PrimaryScreen.Bounds.Width / 3, Screen.PrimaryScreen.Bounds.Height / 4);


2.基本的yes/ok

 if (MessageBox.Show("提示信息""提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
 {
       MessageBox.Show("點了是(Y)");
 }
 else
 {
       MessageBox.Show("點了否(N)");
 }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章