wxRuby - 更改 TextCtrl Style 属性

发布于 2024-09-18 16:32:24 字数 356 浏览 3 评论 0原文

我是 wxRuby 的新手,只是想弄清楚。创建 TextCtrl 后如何更改其样式。

tb = Wx::TextCtrl.new(panel, -1, :style => Wx::TE_PASSWORD)

正确设置文本输入,但是创建后是否可以更改此属性?

tb = Wx::TextCtrl.new(panel, -1)
tb.set_window_style(Wx::TE_PASSWORD)

不执行任何操作,并且在 set_styleset_default_style 中进行替换都会引发错误。

I'm brand new to wxRuby, and just trying to figure things out. How do I change the style of the TextCtrl after it has been created.

tb = Wx::TextCtrl.new(panel, -1, :style => Wx::TE_PASSWORD)

Sets the text input properly, but is it possible to change this property after it has been created?

tb = Wx::TextCtrl.new(panel, -1)
tb.set_window_style(Wx::TE_PASSWORD)

Does nothing, and subbing in set_style or set_default_style each throw errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的他你的她 2024-09-25 16:32:24

我认为 set_style 方法旨在更改文本本身的样式,而不是 textctrl 的样式。我一直在试图找到一个改变textctrl样式的例子,但我还没有找到任何东西。

I think that the set_style method is intended to change the styling of the text itself, not the style of the textctrl. I've been trying to find an example of changing the style of the textctrl, but I haven't found anything yet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文