在winform中,当我创建组合框时,我可以找到事件“SelectedIndexChanged”,该事件在组合框索引更改后起作用
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
MessageBox.Show("after index change app show this MessageBox ");
}
Run Code Online (Sandbox Code Playgroud)
但在 wpf 中,我找不到事件“SelectedIndexChanged”,而不是我可以找到事件“SelectionChanged”,但我在组合框事件索引工作之前使用它时遇到问题,但我想在索引更改后在事件“SelectionChanged”中显示我的代码
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
MessageBox.Show("before index change app show this MessageBox ");
}
Run Code Online (Sandbox Code Playgroud)
我应该怎么办 。我想在更改组合框的索引后显示我的消息框
为我糟糕的英语感到难过
我是初学者,我想获取文本EditText并将其与另一个字符串进行比较.
我想检查写入的文本EditText是否等于'字符串'然后显示a Toast但它不起作用
我调试并检查两者的值是否完全是admin但是如果block不工作并显示else块.
if (editText.getText().toString() == "admin") {
//Never enter this block when i type "admin" in the EditText.
Toast.makeText(MainActivity.this,"ok",Toast.LENGTH_LONG).show();
} else {
Toast.makeText(MainActivity.this,"Wrong User Or Pass",
}
Run Code Online (Sandbox Code Playgroud)