开发者

Finding a control in .net

开发者 https://www.devze.com 2022-12-22 06:30 出处:网络
In vb.net I have control named checkbox1 that I can see at dropdown menu in properties tab. but in designer I am not able to locate it...

In vb.net I have control named checkbox1 that I can see at dropdown menu in properties tab. but in designer I am not able to locate it...

Also when I am selecting CheckBox1 from properties' dropdown menu, no checkbox in designer开发者_如何学编程 gets highlighted....

How to find that control in designer?

pls help me....


When you select the checkbox from the dropdown, look at its properties- is Visible set to false? Also look at the z-order, it might be hiding behind another control.


Select it in the property window, change it's location to 0,0, size to 100,100, and make sure it's got some .Text property assigned.

(ASP.Net or WinForms designer?)


Your control might be hidden due to various reasons (some of them are bugs in the designer's behaviour).

It might be that the control has a size of (0,0), it might be behind some other control, it might have some off-display location such as (-10,-10), etc.

You can try playing around with the Size and Location properties of the control to try and reveal it, but if that fails you may want to do it the ugly way:

  1. cut checkbox1's significant code (if any) from the form designer's code (the Form1.Designer.vb file).
  2. add a new checkbox control to the form using the designer.
  3. change the name of that new checkbox to checkbox1.
  4. paste the significant code you've cut instead of the respective code in checkbox1's designer code.
  5. make sure everything went smoothly (event handlers and other automatically-generated code might be affected).
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号