VB problem, updating a shape object property using a variable

VB problem, updating a shape object property using a variable

Post by Joe "Nuke » Tue, 25 Nov 2003 09:49:36



This may not be the cleanest way to do it but try,

Controls("Server" & a).FillColor = &HFF&

This is really a Visual Basic question, so followups redirected.
 
 
 

VB problem, updating a shape object property using a variable

Post by thechis » Tue, 25 Nov 2003 17:47:27

Hi, a bit slow but it works thankyou very much.

 
 
 

VB problem, updating a shape object property using a variable

Post by Mike Willi » Tue, 25 Nov 2003 18:53:26


A bit slow! I've just tried Joe's suggested method on 100 controls and it
takes about 20 microseconds per control on my machine. That's not slow,
especially when you consider that VB has to wade through the Controls
collection to do the job.

The code on its own will update the fillcolor of all 100 controls in about 2
milliseconds, which is virtually instantaneous as far as the user is
concerned. I'd suggest that you look to your own "check if the server is up"
routine when investigating any "slow code" problem.

Mike