home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,920 of 10,840   
   Sonoman to Randy Birch   
   Re: textbox update   
   29 Oct 04 06:49:56   
   
   From: billgates@microsoft.com   
      
   Thank you Randy, the .Refresh worked beautifully because I have an   
   introduced delay on my loop. It does flicker but it is barely   
   noticeable. The screen updates about every 1/2 second so It looks fine.   
   Later on today with more time I will change all the code to the better   
   method.   
      
   Once again, thanks!   
      
   Randy Birch wrote:   
   > With the code you're using you've got to give Windows a chance to update the   
   > controls.  Normally, e.g. with a listbox or label, you would place a   
   > .Refresh statement in the appropriate place.  But text boxes are   
   > a bit different.   
   >   
   > In your code you are adding a new line and linefeed to dataToTextBox, then   
   > blasting all that data back into txtData. Ditto for txtBuffer. If you add   
   > the Refresh statements your text will update, but flicker like hell.   
   >   
   > What you need to do is append your new data to the end of the textboxes   
   > rather than replace the entire contents, then save the current contents to   
   > the string variable if still required.  This is the idea ...   
   >   
   > for cnt = 1 to 1000   
   >   
   >    'moves to end of text, scrolling if needed   
   >     text1.selstart=len(text1.text)   
   >   
   >    'append the new data   
   >     text1.seltext = myDataString(cnt) & vbCrLf   
   >   
   >    'save new text contents to string if still needed   
   >     dataToTextBox = text1.text   
   >   
   >     'repeat for other textbox   
   >   
   > next   
   >   
   > That will do the trick and not require the Refresh statement.   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca