Visual basic code help

Hello people!

I need some help with my schoolproject.
I have tryed to find code for a VScroll to change the background color(with random function).
But I really cant find it on the webb, so please help me with this code.

Thanks // Gattel

It sounds as if you are thinking of sliders to select the colours - but bear in mind that a colour has three parameters (which can be defined in various ways) or four if you include transparency.

Look for a colour (or color) picker dialog.

It is not clear how selecting the colour would interact with “a random function”…

Well, when I pull the VScroll upp and down I want another colour, for example: at the top it is black and then when I pull it down it will be more brighter and brighter.
I hope I explained better now:)

// Gattel

Random Function would not work the color is set via a control. Try look at http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1512&lngWId=1&txtForceRefresh=101200816524037446

That may help

ideally you should have three sliders, RGB set values of 0 to 255 on each slider and bobs your uncle.

DT.

see if any of the code here helps… end of day with it being a school project I don’t think you’ll get a straight forward answer as it defeats the learning process :wink:

http://www.wolfebyte.com/visual-basic-slider-sample.php

But using what you know and some code tinkering using property statements in the link above should get you closer to your goal.

Not a VB programmer but looks like what you is after is picking up on the slider position within the define limits per defined in the slider properties then feeding that value back into the slider background property via another global or localised variable based on either a lookup table ie. if slidervalue=x then sliderproperty for background colour = “x” or using an incremental increase in the rgb value if thats applicable in VB then i.e. slidercolor=(0+slidervalue%,0+slidervalue%,0+slidervalue%) thus incrementing from black to white if using a 0-255 scale

Hello gattel…
Slightly off topic but i suggested he come here for some help,
I agree with pmm though about the learning bit :wink:
Let us know how u get on with your project m8.
Andy.