1
我的應用程序中有兩個文本框,一個是txtCampaign
,另一個是txtUrl
。爲txtCampaign
tabindex屬性爲1和的TabIndex爲txtUrl
是2製表符在窗口應用程序中不起作用
現在我已經用下面的代碼:
private void txtCampaign_Enter(object sender, EventArgs e)
{
txtCampaign.BorderStyle = BorderStyle.FixedSingle;
txtUrl.BorderStyle = BorderStyle.Fixed3D;
}
private void txtUrl_Enter(object sender, EventArgs e)
{
txtUrl.BorderStyle = BorderStyle.FixedSingle;
txtCampaign.BorderStyle = BorderStyle.Fixed3D;
}
現在,當我從第一個文本框txtCampaign
使用的標籤,因爲它不會讓我去到第二個文本框。
我不知道爲什麼會發生這種情況?但是,如果我刪除上面的代碼其工作正常對我來說
我也不知道。當你設置新的'BorderStyle'值時,你可能會失去焦點。嘗試在事件處理程序中調用'txtBox.Focus()'。如果這不是你的下一個嘗試,也重置事件處理程序中的「TabOrder」值。 – mortb