问题从不同的形式更改标签文本 [英] Problem changing label text from different form

查看:143
本文介绍了问题从不同的形式更改标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个表格,比如Form1,它包含Label1和一个子程序doText(),用于将文本加载到Label1。

Hi

I have a form, say Form1, that contains Label1 and a subroutine doText() that loads text into Label1.

展开 | 选择 | Wrap | 行号

推荐答案

为了清楚起见....


如果我运行MsgBox(& ; Old:来自Form1的& Label1.Text,没关系。如果我从Form2触发doText(),则相同的行输出Old:。


有些东西没有正确定位标签。


谢谢
For clarity....

If I run MsgBox("Old: " & Label1.Text) from Form1 it''s fine. If I trigger doText() from Form2, the same line outputs "Old: ".

Something is not targeting the label correctly.

Thanks


你好robertybob,

我检查了你的示例代码,它改变了标签文本,并在消息框中显示了正确的文本。其他地方一定存在导致问题的问题。您必须在潜艇中发布您实际使用的代码,以便我们能够看到错误。
Hello robertybob,
I have checked your example code and it changed the label text and showed the text in the messagebox fine. There must be a problem somewhere else that is causing the problem. You will have to post the code you are actually using in the subs for us to be able to see what is wrong.


HI robertybob,


如果您有示例请与我们分享,因为我也遇到了这个问题。
HI robertybob,

if you have example please share with us because i have also face this problem.


这篇关于问题从不同的形式更改标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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