Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A VB Tip 1

Status
Not open for further replies.

edderic

Programmer
May 8, 1999
628
0
0
Make a module :<br>
<br>
Add procedure :<br>
<br>
Public Sub ColBox(Obj As Object, BX%, BY%, EX%, EY%, H%, R%, G%, B%, RE%, GE%, BE%)<br>
Dim H2%, H3%, IvR%, IvG%, IvB%<br>
Obj.AutoRedraw = True<br>
Obj.ScaleMode = 3 'pixel<br>
H3 = Int(H / 2)<br>
IvR = Int(RE - R) / H3<br>
IvG = Int(GE - G) / H3<br>
IvB = Int(BE - B) / H3<br>
Do While H &gt;= H3<br>
Obj.Line (BX + H2, BY + H2)-(EX - H2, EY - H2), RGB(R, G, B), B<br>
Obj.Line (BX + H, BY + H)-(EX - H, EY - H), RGB(R, G, B), B<br>
H = H - 1<br>
H2 = H2 + 1<br>
R = R + IvR<br>
G = G + IvG<br>
B = B + IvB<br>
Loop<br>
End Sub<br>
<br>
in you Form load :<br>
<br>
Private Sub Form_Load()<br>
Call ColBox(yurformname, 0, 0, yourformname.ScaleWidth - 1, yourformname.ScaleHeight - 1, 15, 128, 128, 128, 144, 192, 255)<br>
yourformname.Move (Screen.Width - StartForm.Width) / 2, (Screen.Height - StartForm.Height) / 2<br>
Label4.ForeColor = RGB(0, 0, 220)<br>
<br>
End Sub<br>
<br>
<br>
it's nice<br>
<br>
Eric De Decker<br>
<br>

 
Uh looks pretty groovey <br>
What does it do Vern.
 
Eric...<br>
very nice &lt;g&gt;<br>
Is there any way to have it apply to all four sides of the form?<br>
Or...could you comment the code so that us more simple minded folk could figure out how to adapt it?<br>
<br>
Thanks,<br>
<br>
Wayne Davis<br>
quietman@home.com<br>

 
Comments?<br>
<br>
We don't need no stinkin' comments!<br>
<br>
Real programmers do it in 1's and 0's (&quot;hex&quot; - I think they call it) don't they?<br>
<br>
-ml<br>
<br>
p.s. Actually eric - some comments would be nice &lt;smile&gt; <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top