简单问题(送20分)

比如我做了1个程序,里面有个label1,他的caption="Codefund"
我又做了个程序,当我按下command后想读取 第1个程序中label1的caption 请问怎么实现
[105 byte] By [cqy1986848] at [2008-1-9]
# 1
楼主问题很含糊!两个控件在同一个窗体吗?
在同一窗体:
Private Sub Command1_Click()
label1.caption="Codefund"
End Sub
不在同一窗体:
Private Sub Command1_Click()
form1.label1.caption="Codefund"
End Sub

meilidexue at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...
# 2
同意楼上的,楼主所谓的“程序”含义不明!
chanfengsr-巉沨散人 at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...
# 3
不然就是那么简单
chanfengsr-巉沨散人 at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...
# 4
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)

findwindow 找到程序一label1所在窗体的句柄
findwindowex 找到程序一label1的句柄
sendmessage 获取label1的内容
dabie at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...
# 5
好象错了,label没句柄的,呵呵文本框是可以这么做的.
dabie at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...
# 6
是2个自己做好的程序也就是".exe"后缀的
cqy1986848 at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...
# 7
可以利用api获取这个程序的名字,但是caption不是很清楚如何取,只是提供一个思路
# 8
2个程序可以功用1个资源
KrisCn at 2007-10-18 > top of Msdn China Tech,visual basic,基础类...