社区
C#
帖子详情
c# winfrom 用户控件的属性为何无法改变,有解决办法吗?
mick55
2010-07-13 10:09:37
请教 c# winfrom 用户控件的属性为何无法改变,有解决办法吗?
我自定义了一个 用户控件 lbl(lable),他的text 被我设置为了 caption
在winfrom 中我 拖入了 lbl
1、属性中 无text 属性了;
2、我在 form_Load 代码中 执行 this.lbl.text='abc' 无异常,但是 text还是caption,无变化。
...全文
366
3
打赏
收藏
c# winfrom 用户控件的属性为何无法改变,有解决办法吗?
请教 c# winfrom 用户控件的属性为何无法改变,有解决办法吗? 我自定义了一个 用户控件 lbl(lable),他的text 被我设置为了 caption 在winfrom 中我 拖入了 lbl 1、属性中 无text 属性了; 2、我在 form_Load 代码中 执行 this.lbl.text='abc' 无异常,但是 text还是caption,无变化。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
mick55
2010-07-14
打赏
举报
回复
[Quote=引用 1 楼 wuyq11 的回复:]
[CategoryAttribute("自定义"),
DescriptionAttribute(""),
DefaultValue(true)]
public string Title
{
get{ return this.title; }
set{ this.title= value; }
}
[/Quote]
参考了上述方法,实现了
private string _text = "";
/// <summary>
/// 翻译前的字段名称
/// </summary>
[Description("翻译前的字段名称"), Category("翻译前的字段名称"), Browsable(true)]
public string text
{
set
{
_text = value.ToString() ;
this.lbl.Text = _text.ToString();
}
get { return _text.ToString(); }
}
mick55
2010-07-13
打赏
举报
回复
[Quote=引用 1 楼 wuyq11 的回复:]
[CategoryAttribute("自定义"),
DescriptionAttribute(""),
DefaultValue(true)]
public string Title
{
get{ return this.title; }
set{ this.title= value; }
}
[/Quote]
不是很明白,上述代码是要写在 用户控件 定义中,还是form中。希望说明详细一点。
wuyq11
2010-07-13
打赏
举报
回复
[CategoryAttribute("自定义"),
DescriptionAttribute(""),
DefaultValue(true)]
public string Title
{
get{ return this.title; }
set{ this.title= value; }
}
c#
winfrom
皮肤
控件
将IrisSkin2.dll添加工具箱中
winfrom
分页
控件
3. 利用DataGridView
控件
:内置的DataGridView
控件
本身就支持分页,可以通过设置其`VirtualMode`为`true`和`RowCount`
属性
来实现。不过,这种方式可能需要手动处理数据加载和显示。 在实际应用中,分页
控件
通常与...
C#
WinFrom
分页
控件
一款开源的,很漂亮,很实用的
WinFrom
分页
控件
.使用方法里面有说明!
C#
Winfrom
Chart
控件
柱状图、折线图
介绍了Winform常用图表到基本用法 原帖子地址:https://blog.csdn.net/qq_38693757/article/details/125513359?spm=1001.2014.3001.5502
C#
winfrom
窗体显示百度地图
2. 设置WebBrowser
控件
的
属性
,如Dock
属性
通常设置为Fill,使得
控件
充满整个窗体。 3. 编写代码来加载HTML页面。在
C#
中,可以通过`webBrowser1.Navigate()`方法加载本地或网络上的HTML文件。例如: ```csharp ...
C#
111,120
社区成员
642,537
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章