And if you need to effect to go from left to right (rather than up and down), you just need to change some of the values around.
LOCAL lnRow
ThisForm.ScaleMode = 3
ThisForm.DrawWidth = 1
FOR lnRow = 0 TO ThisForm.width
ThisForm.ForeColor = RGB(0,0,255-255*lnRow/ThisForm.width)
ThisForm.Line(lnRow, 0,lnRow,ThisForm.height)
NEXT lnRow
>Thanks Mike,
>
>I'll try it out. It looks like I've now got three possible solutions:
>1. your code
>2. the gradient code from the downloads section here
>3. some code to create a bitmap on the fly
>
>>Perhaps this simple bit a of code will permit you to acheive what you need (put this in the init of your form.
>>
>>
LOCAL lnRow
>>
>>ThisForm.ScaleMode = 3
>>ThisForm.DrawWidth = 1
>>
>>FOR lnRow = 0 TO ThisForm.Height
>> ThisForm.ForeColor = RGB(0,0,255-255*lnRow/ThisForm.Height)
>> ThisForm.Line(0, lnRow, ThisForm.Width, lnRow)
>>NEXT lnRow
>>
>>
>>>Hi Mike,
>>>
>>>thanks, I had found that link, but didn't want to pay for it as I have never come across an API function that someone wasn't able to help me with. It turns out that using this function with VFP is very difficult due to the way VFP forms hwnds are handled, so I can't use it anyhow. :(
>>>
>>>Thanks for the suggestion.
>>>
>>>Frank