我的其他buttons
正常工作,而此button
无效。
这是我的代码段:
public class RegisterActivity : Activity
{
EditText txtfullname;
EditText txtaddress;
EditText txtusername;
EditText txtpassword;
EditText txtconfirmpass;
Button btncreate;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.registerPage);
txtfullname = FindViewById<EditText>(Resource.Id.editTextFullname);
txtaddress = FindViewById<EditText>(Resource.Id.editTextAddress);
txtusername = FindViewById<EditText>(Resource.Id.editTextUsername);
txtpassword = FindViewById<EditText>(Resource.Id.editTextPassword);
txtconfirmpass = FindViewById<EditText>(Resource.Id.editTextConfirmPassword);
btncreate = FindViewById<Button>(Resource.Id.buttonRegister);
btncreate.Click += Btncreate_Click; //this doesn't get process even though I have an onclick of it
}
答案 0 :(得分:1)
首先确保 Resource.Id.buttonRegister
是您按钮的ID
您创建 EventHandler
的时间:
btncreate = FindViewById