窗口形式的用户控件 [英] User control in window form

查看:57
本文介绍了窗口形式的用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在窗口形式中使用自定义用户控件,首先我不希望在点击按钮后看到我的用户控件我想让我的用户控件显示为true,为此我想要下面的编码;



ctlUser 是我的用户控件ID。



页面加载:

I am using Custom user control in window form and first i don't want to saw my user control after click on button i want my user control visible true and for this i want below coding;

ctlUser is my user control ID.

On page load :

ctlUser.visible=false;



按钮点击事件:


On Button click event:

ctlUser.visible=true;

推荐答案

通常它会显示usercontrol if你在按钮点击事件中看到该属性

这意味着ctlUser.visible = true;没问题



但是检查上面用户控制表格中的任何其他控件



检查用户控件是否可见通过更改usercontrol背景颜色...



检查执行流程是否偏离其他地方并更改属性...等。



否则发布您的代码部分..
Normally it will show the usercontrol if you make the property visible in button click event
that means ctlUser.visible=true; is ok

But check any other controls are there in the form above user control
or
check the user control is visible or not by changing usercontrol background color...
or
check the execution flow is deviating to some other place and changing the property ...etc.

else post your code part..


这篇关于窗口形式的用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆