Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic


Check out the attached screenshot...

If you are interested, email me and i'll send you my VB code. On my P200 MMX PC it is almost instant to refresh the screen. The main limitation is that the form doesn't refresh in real-time yet, but I'm working on that.

If I may say so, its pretty cool!

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Gradient Fill

I was trying to create a gradient fill for a background and found this great code. But am having trouble modifying it.

I only need 2 colors and the gradient to go from top to bottom. I'm new at this and have tried switching the ScaleHeight and Width and have not had much luck can anyone assist me?


Private Sub Form_Resize()
' Form resized so redo the gradient

Dim hw As Single, rd As Single, bd As Single, gd As Single
Dim r As Single, b As Single, g As Single 'from colors
Dim dr As Single, db As Single, dg As Single 'to colors
Dim sw As Single
Dim i As Long

sw = ScaleWidth
r = 0: g = 255: b = 0 'from Red
dr = 0: dg = 0: db = 255 'to Blue
' r = 192: g = 0: b = 192 'from Dark Magenta
' dr = 255: dg = 255: db = 255 'to White
hw = sw / 2 'Determine the range to the middle of the form
rd = (dr - r) / hw 'Red Delta = change in Red / Range (color change per pixel)
gd = (dg - g) / hw 'Green Delta
bd = (db - b) / hw 'Blue Delta
For i = 0 To hw 'From the edge to the middle
Me.Line (0 + i, 0)-(0 + i, ScaleHeight), RGB(r, g, b) 'draw left vertical line
Me.Line (sw - i, 0)-(sw - i, ScaleHeight), RGB(r, g, b) 'draw right vertical line
r = Add(r, rd) 'Increment (or decrement) red by the delta
g = Add(g, gd) 'Adjust Green
b = Add(b, bd) 'Adjust Blue

End Sub

Fill Box With Gradient
Hello i want to make an expandeble menu, so i've added severel rectangles and now i want to fill them with a gradient. But it seems its just nog possible in VBA, the code i normally use in vb returns errors, so is there anyone who can tell me how i give a box a gradient color?


Gradient Fill Without Api
Hi folks,

Does anyone know how to code a gradient fill from something like RGB(144, 204, 253) to white.

I've been hunting round the net and all i've found is gradient fills to black and not white.

Also it has to be compatible with NT4. I've code that uses the msimg32.dll and is perfect but it doesn't seem to work under NT. Something about not being compatible with gd32.dll.


Gradient Fill On Mdi
Hi Folks,

I'm trying to do a gradient fill using the below code on an mdi form. mdi's don't seem to have the properties It needs. Has anybody any other solutions.


got the code for the gradient fill from

Code: Private Sub DrawGradientFillTriangle(dwColour1 As Long, _
                                     dwColour2 As Long, _
                                     dwColour3 As Long, _
                                     dwColour4 As Long)
   Dim grTri(0 To 1) As GRADIENT_TRIANGLE
   Dim vert(0 To 3) As TRIVERTEX
  'Colour at upper-left corner
   With vert(0)
      .X = 0
      .Y = 0
      .Red = LongToSignedShort(CLng((dwColour1 And &HFF&) * 256))
      .Green = LongToSignedShort(CLng(((dwColour1 And &HFF00&) &H100&) * 256))
      .Blue = LongToSignedShort(CLng(((dwColour1 And &HFF0000) &H10000) * 256))
      .Alpha = 0
   End With
  'Colour at upper-right corner
   With vert(1)
      .X = Me.ScaleWidth Screen.TwipsPerPixelX
      .Y = 0
      .Red = LongToSignedShort(CLng((dwColour2 And &HFF&) * 256))
      .Green = LongToSignedShort(CLng(((dwColour2 And &HFF00&) &H100&) * 256))
      .Blue = LongToSignedShort(CLng(((dwColour2 And &HFF0000) &H10000) * 256))
      .Alpha = 0
   End With

  'Colour at lower-right corner
   With vert(2)
      .X = Me.ScaleWidth Screen.TwipsPerPixelX
      .Y = Me.ScaleHeight Screen.TwipsPerPixelY
      .Red = LongToSignedShort(CLng((dwColour3 And &HFF&) * 256))
      .Green = LongToSignedShort(CLng(((dwColour3 And &HFF00&) &H100&) * 256))
      .Blue = LongToSignedShort(CLng(((dwColour3 And &HFF0000) &H10000) * 256))
      .Alpha = 0
   End With
  'Colour at lower-left corner
   With vert(3)
      .X = 0
      .Y = Me.ScaleHeight Screen.TwipsPerPixelX
      .Red = LongToSignedShort(CLng((dwColour4 And &HFF&) * 256))
      .Green = LongToSignedShort(CLng(((dwColour4 And &HFF00&) &H100&) * 256))
      .Blue = LongToSignedShort(CLng(((dwColour4 And &HFF0000) &H10000) * 256))
      .Alpha = 0
   End With
   With grTri(0)
      .Vertex1 = 0
      .Vertex2 = 1
      .Vertex3 = 2
   End With
   With grTri(1)
      .Vertex1 = 0
      .Vertex2 = 2
      .Vertex3 = 3
   End With
  'hdc - display context handle of the target window
  'vert(0) - first member of interest in the vert() array
  '4 - number of vert() array members (not ubound(vert))
  'grTri(0) - first member of interest in the grTri() array
  '2 - number of grTri() array members (not ubound(grTri)
  'GRADIENT_FILL_TRIANGLE - fill operation
   Call GradientFill(Me.hdc, vert(0), 4, grTri(0), 2, GRADIENT_FILL_TRIANGLE)

End Sub

Private Function LongToSignedShort(dwUnsigned As Long) As Integer
  'convert from long to signed short
   If dwUnsigned < 32768 Then
      LongToSignedShort = CInt(dwUnsigned)
      LongToSignedShort = CInt(dwUnsigned - &H10000)
   End If
End Function

Edited by - nige on 7/25/2004 4:37:14 AM

Gradient Fill?
Does anyone know how to fill a form (or a picture box) with a gradient? Any help would be appreciated?


Can I Fill The Regions With Gradient Colors?
Greetings every body,

I'm using regions alot these days, and I want to fill specific regions with gradinet colors
What I want is gradinet from both sides so it gives rhe 3D effect "e.g a tank of water"

Did any body has a function or so to do this ?

Thanks in advance.

Transparent Image And Fill Colours
Can anyone help,

I have an form that i am using to maintain absences.
Each kind of absence has a colour associated to it.
I have a .GIF file which is a picture of a paint brush in the middle of it and the rest is transparent.
Now, what i want to do is to have that image sitting on my form and when the user clicks any kind of absenece i want the fill colour or something equivilant to it to change around the image.

Can this be done ?
I have had my image on the form in a image and picture box.
The image control is my preferred as it can stretch the pic.
But it does not seem to have a fill colour propertie.

Any advice would be great.



Using API Ellipse Function On A Memory DC - Can't Fill Transparent

This question also appears in Rod Stephens' EarthWeb forum. I can't seem to get the Ellipse function to draw with the interior transparent when drawing on a memory DC. I have tried several combinations of SetBkColor and SetBkMode without success. What am I missing? Code appears below.

You need a Form, two PictureBoxes with the ScaleMode set to vbPixels, an image at least 200x200 pixels large in Picture1, and a command button that calls the subroutine "DrawEllipseInMemory".

Thanks a ton!

Private Sub DrawEllipseInMemory()

Dim aPic As StdPicture
Dim tempDC As Long, tempDCBmp As Long
Dim picDC As Long, picDCOrigBmp As Long

Set aPic = Picture1.Picture

picDC = CreateCompatibleDC(0)
picDCOrigBmp = SelectObject(picDC, aPic.Handle)

tempDC = CreateCompatibleDC(picDC)
tempDCBmp = CreateCompatibleBitmap(picDC, 100, 100)
SelectObject tempDC, tempDCBmp
SetBkColor tempDC, vbWhite
SetBkMode tempDC, 1

BitBlt tempDC, 0, 0, 100, 100, picDC, 100, 100, vbSrcCopy
Ellipse tempDC, 0, 0, 100, 100
BitBlt Picture2.hDC, 0, 0, 100, 100, tempDC, 0, 0, vbSrcCopy

SelectObject picDC, picDCOrigBmp
DeleteDC picDC
DeleteObject picDCOrigBmp
DeleteDC tempDC
DeleteObject tempDCBmp

End Sub

&lt;Insert witty comment here&gt;

Gradient Form
Hello, I have two questions about a gradient form background.

Currently I'm using the code below, but it only goes from top to bottom. How can I make it go from left to right, top-left to bottom-right and top-right to bottom-left (diagonal)?

Is it also possible with a scrollbar to select the point where the first color has to change into the second color? For example, 70% has to be Red and from that point it starts changing into White.

vb Code:
Private r1 As Integer, g1 As Integer, b1 As IntegerPrivate r2 As Integer, g2 As Integer, b2 As Integer Sub DrawGradient(frm As Form)Dim R As Integer, G As Integer, B As IntegerDim i As Integerfrm.ClsFor i = 0 To 100    R = r1 - (((r1 - r2) / 100) * i)    G = g1 - (((g1 - g2) / 100) * i)    B = b1 - (((b1 - b2) / 100) * i)    frm.Line (0, (frm.ScaleHeight / 100) * i)-(frm.ScaleWidth, (frm.ScaleHeight / 100) * i), RGB(R, G, B)Next iEnd Sub Sub WhiteBlue() r1 = 255 g1 = 255 b1 = 255 r2 = 161 g2 = 192 b2 = 236 frmMain.Cls Call DrawGradient(frmMain)End Sub Private Sub Command1_Click()    Me.AutoRedraw = True    Me.DrawWidth = Me.ScaleHeight / 255    WhiteBlueEnd Sub

Gradient Form
Does anyone know how to make a form and its caption look Gradient in appearance?

Any replies appreciated.

Gradient Form
i have attached a zip file of code to do gradient on a form.

it has a small problem. when i bring up a form over the gradient form, the gradient form loses the gradient over the portion of the form covered by the top most form.

would someone see if this can be fixed?

it seems to be great code.

Set Form Like Gradient Opaci
hello you there,

i wonder if it possible to make the form like gradient opacity, something like black to transparent gradient.

i know how to set all the form to transparent but it's not enought.

i'll glad for any tutorial / code (VB6/VB.NET/C#)

thanks alot,


Gradient Backcolor Of A Form
Good day!

Can somebody here tell me how to make and set a gradient fill backcolor in a form?

Thanks a lot!

Set Form Like Gradient Opaci
hello you there,

i wonder if it possible to make the form like gradient opacity, something like black to transparent gradient.

i know how to set all the form to transparent but it's not enought.

i'll glad for any tutorial / code (VB6/VB.NET/C#)

thanks alot,


Gradient Form Backcolor
Hi, i was wondering how to make a form gradient color. I have seen alot of demos but what I am looking for is done by line. The others where done by labels if you understand me I really appreciate if you help me and give me an example.

Thanks in advance

Gradient Effect To Form
How to give gradient effect to the form?

Pass the Start and End Colors as Parameters.

[UNRESOLVED] Transparent Label On Transparent Form Problem.
hey guys, i have made my mdi childs transparent but the labels on those forms are not transparent even when they are set to BorderStyle = 0. Project attached, can anyone give any pointers? i need all labels to be truly transparent. also, i need to set the statusbar to a certain RGB color, how can this be done.

Rounded TextBoxes On Gradient Form???
I know how to create the rounded textbox (thanks to the wonderful world of Xtreme VBTalk) and I know how to make a gradient form, what I was wondering was, can I combine the two features?

I have tried but if I make the form gradient my textboxes revert to textboxes with no border.

Any Ideas?

Yes I Did Search.

And I am sorry if this is more of a General forum question.

Transparent Form - Semi Transparent Controls
Hello every one,

I am using Visual Basic 6. Is there way I can make form background 100% transparent and all controls on form semi-transparent?

Thank you,
Javed Yusuf

[Email address removed — Mod]

Drawing Transparent PNG's Onto A Transparent Form
Hi All

I'm having trouble drawing a transparent PNG onto a transparent form in VB6. What I want to be able to do is to start with a completely transparent form, and draw an alpha-blended PNG onto it. I've attatched a pic of what I would like to do.

I would like to do this preferably without any specific API's or DLL's that aren't included with windows XP, but I can be flexible if necessary.


Transparent Form + Transparent Image
I made my form transparent, however I have a .gif file that I want to be transparent, but when I add it to my transparent form, it shows the back of the form where the transparent image should be showing. How can I prevent this?

Thanks in advance.

Transparent Label On Transparent Form
Have code to create a transparent form, but when I try to put a transparent label control on that form, the BackColor of the label is that of the default BackColor for a form.

Any way to make the label truly transparent through transparent form?

Transparent Label On A Transparent Form
Already have code to create a transparent form, but when I try to put a transparent label control on that form, the BackColor of the label is set to that of the default BackColor for a form.

Any way to make the label truly transparent through transparent form?

Transparent Form And Transparent Image
I'm a little stuck in this problem:

I need a form to have a form shaped like a circle...
...there is no problem in making the form transparent,
but I need a picture (a ball, could be .gif or .png) to be
on that form without having the background of the .gif.

The .gif has already a transparent part, but
there is still the background of that picture box.

Has anyone an idea?


[ - the bright site of life ]

Picture With Transparent Bk On Transparent Form
How to create the transparent background picture on the transparent form...

Picture With Transparent Bk On Transparent Form
How to create the transparent background picture on the transparent form...

Vb6 - Form.add - Fill Text On Create Form
I am using:

  dim FormName as string
  FormName = "alert"
  forms.add(FormName).visable = true

there is a text1 on the alert form.

how do i fill text1.text after i create the form instance using the above code?


Form Fill...?
I'd like to make a program to fill web Forms, i'v seen that here, but i can't find it...
can anyone help me?

Fill The PDF Form?

I want to populate the database field into the "Filable PDF form" , does anyone did that before? how to do it.

The database is from MS Access, ideally, when user fill out all the info on the form when press a button, it launch the pre-defined fillable PDF form and populate the data into the PDF form.


To Fill In A Form
I'm trying to built a tool that automatically logs in to my webmail provider and forwards my inbox to my 'official' mail account (unfortunately only possible manually by web access ).
the base frame is already done. only missing function is to fill out one single field of a web form: forward to.

VB Code:
Body = brwWebBrowser.Document.Body.innerhtml    Body = AfterFirst(Body, "CMP_regRunOnLoad")    inbox = ""    While InStr(Body, " value=INBOX.") > 0        Body = AfterFirst(Body, " value=INBOX.")        tmp = BeforeFirst(Body, " ")        inbox = inbox & "f%5Bmsgid%5D%5B%5D=INBOX." & tmp & "&"    Wend    If inbox <> "" Then inbox = "&" & inbox & "p%5BorderBy%5D=InternalID&p%5BorderSeq%5D=DESC&p%5BpageSel%5D=0&p%5Baction%5D=forward&p%5BfolderTo%5D=&p%5Bfolder%5D=INBOX&p%5BDOSEARCH%5D=&p%5BSEARCHSTRING%5D=&p%5BSEARCHFIELD%5D=&p%5BSEARCHFOLDER%5D=&p%5BSEARCHSTATUS%5D=&p%5BSEARCHPRIO%5D=&p%5BSEARCHFROM%5D=&p%5BSEARCHTO%5D=&p%5BSEARCHDATE%5D=&p%5BSEARCHDATETYPE%5D=&p%5BRESTOREFOLDER%5D="    Post "", "ctl=write_email" & inbox     While brwWebBrowser.Busy        DoEvents    Wend     brwWebBrowser.Document.Forms(0).Elements(1).Value = "forward_to_address"

unfortunately it doesn't work the way it should. (the field is correct!) but the inserted text isn't shown in formular
searching on the web haven't helped me so far

maybe anyone can tell me what's wrong with that line or can give me a hint.
that's an excerpt of the html code:


<td valign="top" style="width:455px;padding:5px 5px 0px 5px;">
<table border=0 cellpadding=0 cellspacing=0 height="100%">
<form name="DATA" method="post" onsubmit="return false;">
<td style="width:65px">
<td colspan=2>
<select name="FROM" size="1" style="font:normal 12px Arial;width:225px;">
<option value=""></option>
</select>&nbsp;<a href="javascript:CMP_puSTC('index.php?ctl=booking&p[bookserv]=viewAlia&p[mode]=popup');"> Zusätzliche eMail-Adressen</a>
<a href="javascript:KC_selectInput('TO');openMiniABFromKC(listpuurls['To']);">An</a>
<input tabindex="1" onfocus="KC_selectInput('TO');" onblur="KC_deselectInput('TO');" id="TO" name="TO" class="addr" type="text" value="" style="width:390px;" />

Combinding A Solid Form And A Semi Transparent Form
I'm tring to Create a splash screen out of two forms one that would be solid and the other semi-transparent and overlaping the solid form to give the appriance of one form with a semi-transparent border. I have tried to do it with a mdi form but both the forms are semi-tranparent. Anyway if anyone can help I would be greatful.


Auto-fill From A Value In A Form To That Form
I have a form that I want the user to choose a name from a drop down list. Then from that name I want and address and a description automatically filled in. All values are comming from a table into a form and being saved into another table. I can get the drop down box to recognize the names, but I don't see how to get the selection to auto-fill to the other fields.

Please help!

Thanks, Susan

Getting The Form To Fill The Screen
hi does anyone know how i can get a form to fill the whole screen on no matter what size monitor i run the program on

Fill Out Online Form With Vba
Thanks for the help on my previous question. Unfortunately its not over for me.
I am not sure how to open a web page (that exists) online and fill it out through the macro. As I understand I need to somehow instantiate explorer, navigate it and fill the forms.

IF possible I would appreciate any useful links or material/code that might be relevant to this task. Thank you.

Fill In A Word Form From VB?

I have a VB program that needs to open a Word document, fill in some fields in that document (like checkboxes and text fields), print it and close. I can not figure out how to have VB fill in the form fields. I have this code already:

Dim WordApp As Word.Application
Dim WordDocument As Word.Document

Set WordApp = New Word.Application
Set WordDocument = WordApp.Documents.Add("c:clientsappsqctemplate.doc")

WordApp.Visible = True



It opens word and the document but I can not access the fields. WordApp.ActiveDocument.FormFields.count returns 0. Can you guys help? Thanks.

Auto Fill Web Form
I have seen a program that will auto fill up a web form, this is very useful if you fill up web forms many times with the same info.

I am wondering how can I do that... thanks in advance

Flash (.swf) To Fill Whole Form?
I am using the shockwave flash com to add a .swf to a form. It works fine.

However, is there a way to make it so the .swf fills the whole form... to stretch so it fits inside the form exactly independent on the size of the form?

Fill A Form Using A Recordset

I've spent 2 hours searching for the right sample so I decided to stop wasting my time and ask.
I'm trying to fill an unbound form with data from my table. It has to be able to scroll through, add, delete and update records. I don't want to use bound form since the BE will be on the server and I hope this will speed it up a bit. By the way there will be more than one user entering data at one time, so I hope this will work too.

Does anyone have any suggestions or can point me in the right directions?


How Do I Get Form Color &amp; Fill A DC
OK. here's the setup.

I've done "create compatable DC" and "create compatable bitmap" and have them saved in (long) variables.
Now I want to get the form's color and floodfill the DC with it.
Any ideas on how this is done?

Fill In A Web Form And Submit It Using VB ?
Hi there, i'm kind of a newbie 2 VB and this is actually my first post here...
I was wondering if there is anyway to fill in a form which is on a web page using VB and submit it ?

Thanks in advance.

Fill In Form With No Action?
Is it possible to fill in a form with no action using inet? Image of what I mean:

Form Fill Up In IE NOT Using Webbrowser
I have an HTML form open in IE window. I need to write a VB6 application that will have a button and on click of the button the data (lets say User Id and Password which will be read from a file) will be posted to the HTML form automatically. I want to state that the HTML form is not embedded in normal webbrowwser or Inet control inside the Vb application - it is running in the IE browser and I need to post data to it from a VB6 application.
Any help is much appreciated.


Popup Form Fill
So lets say I have:

vb Code:
Private Sub Command1_Click()Webbrowser1.Document.All("q").Text = Test.TextEnd Sub
But I want it to open a new internet explorer to do that, wwhaat would I do then?

How Do I Fill In A Dropbox On A Form?
Any Help !! I need to filling in a dorp box on a web form here the code

<tr >
<td align="right" width="150" class="yregfieldtitle"><span class="yregasterisk">*</span>&nbsp;<LABEL for="sex" accesskey="G">Gender:</LABEL></td>
<td nowrap width="10"><spacer type="horizontal" width="10"></td>
<td align="left" width="560">
<select name=".sx"id="sex"><option value="">[Select]
<option value="m">
<option value="f">

Iv tried WebBrowser1.Document.getElementById("sex").Value = M
and WebBrowser1.Document.getElementById(".sx").Value = M

Fill Up A Html Form
I want to fill up a HTML Form using VB. Is it possible?


Fill Form In Other Application

How can fill the fields in other application using sendkeys with VBA ?

somebody has a example, How can put data in the form

Fill And Print Form
hello everyone

i would need help how to easily make a form that user could fill in and print from vb?

Auto-fill Web Form
Thakns but I think you misunderstood or I am. I want to fill a text box in IE, not my own browser control. The way some submission programs work to fill the fields. Also kind of like that AL Robo Form does

Copyright © 2005-08, All rights reserved