Home >Backend Development >C#.Net Tutorial >C# uses Xamarin to develop applications -- Alert Box
public static class AlertExtension { public static void ShowAlert(this Activity activity ,string msg,string title = "", string btnText = "OK"){ AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.SetTitle(title); builder.SetMessage(msg); builder.SetCancelable(false); builder.SetPositiveButton(btnText, delegate { // it is alert ,keep it simple , do nothing here }); builder.Show(); } }
Huancuan敕镞讹综合
if(txtPwd.Text != txtCfmPwd.Text){ this.ShowAlert("Password and confirmed password not match"); }
The above is the content of C# using Xamarin to develop applications-Alert Box, more For more related content, please pay attention to the PHP Chinese website (www.php.cn)!