VB 2005 query

Status
Not open for further replies.

saurabh.sauron

Ambassador of Buzz
I am facing two problems in VB 2005

1.)I want to change color of the form when I use the horizontal scrollbar. the code i use is

Code:
Me.backcolor=RGB(Hscrollbar1.value,Hscrollbar2.Value,Hscrollbar3.Value)

this doesnt work, though it works in VB 6.0

2.)I want to load a picture in a picture box when i click on a button. The code for the command button is:-

Code:
Picturebox1.Picture=LoadPicture("path")

This doesnt work either.
pls help
thnx
 

rajesh_nk22

Journeyman
HI

Solution..

For 1st one use this Me.BackColor = Color.FromArgb(Hscrollbar1.value,Hscrollbar2.Value,Hscrollbar3.Value)

for 2nd one, use
PictureBox1.Image=image.FromFile("path")
 
OP
saurabh.sauron

saurabh.sauron

Ambassador of Buzz
thnx a lot...it worked.

to make a correction,
Me.BackColor = Drawing.Color.FromArgb(HScrollBar1.Value, HScrollBar2.Value, HScrollBar3.Value)
 

rajesh_nk22

Journeyman
Drawing.Color

By default "Drawing" is not required there becoz drawing namespace is imported in VB 2005 by default,
 
Status
Not open for further replies.
Top Bottom