当前位置:编程学习 > C#/ASP.NET >>

webbrowser中下拉框不停地获取焦点.

在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();


文本框中获取与释放焦点都很正常,但是在下拉框中却不停地重复获取焦点,释放焦点,导致其他文本框获取焦点以后又还原到以前的焦点上了...求解..! --------------------编程问答-------------------- 去掉单机事件只留下获取焦点事件也是一样的...但是仅进行单机事件无法获取焦点.. --------------------编程问答-------------------- 什么情况?没人么?
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,