在webbrowser中的下拉框我怎么赋值以后调用focus()再调用removefocus()后就开始不停地获取焦点不释放,打断点上去没有看见在重复执行....这是个啥情况啊.....HtmlDocument doc = webBrowser1.Document;
//文本框
doc.All["nick"].Focus();
doc.All["nick"].RemoveFocus();
Thread.Sleep(200);
doc.All["password"].Focus();
doc.All["password"].RemoveFocus();
Thread.Sleep(200);
doc.All["password_again"].Focus();
doc.All["password_again"].RemoveFocus();
//下拉列表
doc.All["year_value"].InvokeMember("click");
Thread.Sleep(200);
doc.All["year_value"].Focus();
doc.All["year_value"].InnerText = "1992年";
doc.All["year_value"].RemoveFocus();
doc.All["month_value"].InvokeMember("click");
Thread.Sleep(200);
doc.All["month_value"].Focus();
doc.All["month_value"].InnerText = "9月";
doc.All["month_value"].RemoveFocus();
doc.All["day_value"].InvokeMember("click");
Thread.Sleep(200);
doc.All["day_value"].Focus();
doc.All["day_value"].InnerText = "4日";
doc.All["day_value"].RemoveFocus();
文本框中获取与释放焦点都很正常,但是在下拉框中却不停地重复获取焦点,释放焦点,导致其他文本框获取焦点以后又还原到以前的焦点上了...求解..!
//文本框
doc.All["nick"].Focus();
doc.All["nick"].RemoveFocus();
Thread.Sleep(200);
doc.All["password"].Focus();
doc.All["password"].RemoveFocus();
Thread.Sleep(200);
doc.All["password_again"].Focus();
doc.All["password_again"].RemoveFocus();
//下拉列表
doc.All["year_value"].InvokeMember("click");
Thread.Sleep(200);
doc.All["year_value"].Focus();
doc.All["year_value"].InnerText = "1992年";
doc.All["year_value"].RemoveFocus();
doc.All["month_value"].InvokeMember("click");
Thread.Sleep(200);
doc.All["month_value"].Focus();
doc.All["month_value"].InnerText = "9月";
doc.All["month_value"].RemoveFocus();
doc.All["day_value"].InvokeMember("click");
Thread.Sleep(200);
doc.All["day_value"].Focus();
doc.All["day_value"].InnerText = "4日";
doc.All["day_value"].RemoveFocus();
文本框中获取与释放焦点都很正常,但是在下拉框中却不停地重复获取焦点,释放焦点,导致其他文本框获取焦点以后又还原到以前的焦点上了...求解..!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货