Am 01.08.2010 21:17, schrieb C:
> Changing the background colour of a Form changed the background colour
> of several controls on it, as if they were transparent. I think this
> change from VB6 is quite crazy, and I wonder if there are simple ways
> around this.
See 2nd paragraph in the "remarks" section
http://msdn.microsoft.com/en-us/libr...backcolor.aspx
and the (therein linked) 3rd paragraph here
http://msdn.microsoft.com/en-us/libr...s.control.aspx
about "ambient properties".
> The only thing I can think of is to change the colour of all controls
> in a For loop - not a very decent solution, but Microsoft seems to do
> a lot of illogical things - user hostile.
Well, I am happy that I don't have to manually change the colors
of all controls if I change the Form color because it's done
automatically. ;-)
> Something like
>
> Dim ctrl As Control
> For Each ctrl In Form1.Controls
> If Type ctrl Is button Then ctrl.BackColor =
> Color.FromArgb(128, 255, 92)
> If Type ctrl Is label Then ctrl.BackColor =
> Color.FromArgb(128, 128, 128)
> Next
You can also select multiple controls in the designer, then set
their backcolor properties in one go.
--
Armin