By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Update a control's text from another class...?

P: 3
Hi all!

I'm trying to do a pretty simple thing in VB6, but it's not working!

In the main form:
Expand|Select|Wrap|Line Numbers
  1. Sub Command1_Click()
  2.     Dim cls1 As New Class1
  3.     cls1.fnc1 StatusBar1.SimpleText
  4. end sub
And in Class1:
Expand|Select|Wrap|Line Numbers
  1. Function fnc1(ByRef logText As String)
  2.     Dim i as Integer
  3.     For i=0 To 10
  4.         logText = "We're at number " & i
  5.     Next
  6. End Function
  7.  
I though this would update the statusbar text in real time, but it doesn't work!
Anyone knows why?
Apr 22 '08 #1
Share this Question
Share on Google+
2 Replies


debasisdas
Expert 5K+
P: 8,127
What is the return type of the function ?

You are not assigning back anything to the statusbar.
Apr 22 '08 #2

P: 3
What is the return type of the function ?

You are not assigning back anything to the statusbar.
I don't think the function should have to return anything (I could have made it into a sub). The goal is to update the statusbar while cls1.fnc1() is running. By sending the statusbar's text property as a reference I should be modifying the actual object, thus updating the real statusbar. Unfortunately the statusbar remains empty!
Apr 22 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.