|
-
Jan 20th, 2002, 11:33 AM
#1
Thread Starter
Lively Member
How can I specify one of my custom colors in code?
I would like to be able to change the color of a certain line on my form when an option button is clicked. The color is a custom color that I created. (you know, one of those that goes down in the extra white spaces in the pallette) Well anyway how can i make the line change to one of those colors when i click the option button.
Thanks!
Eric
-
Jan 20th, 2002, 11:41 AM
#2
Are you talking about a "line" or are you talking about a line of text (Label).
It's the same both ways, just use the .backcolor, .forecolor properties for the label and the .bordercolor for the line.
-
Jan 20th, 2002, 11:41 AM
#3
Hyperactive Member
use the RGB function....eg
object.line (125,521)-(521,125),RGB(123,321,213)
obviously you have to susbtitute the "(123,321,213)" with you custom colours(if you're american, then 'colors' )
When I write my code, only God and I know what it means. But a week later, only God knows.
-
Jan 20th, 2002, 11:43 AM
#4
forgot to include example:
VB Code:
Line.BorderColor = &H8080FF
That's how you assign the color with Hex
-
Jan 20th, 2002, 11:44 AM
#5
Frenzied Member
If you are using the Line Control and the CommonDialog Control you set the BorderColor of the Line Control to the Color property of the CommonDialog control...
VB Code:
Private Sub Form_Load()
On Error Resume Next
CommonDialog1.CancelError = True
CommonDialog1.ShowColor
If Err.Number = cdlCancel Then Exit Sub
Line1.BorderColor = CommonDialog1.Color
End Sub
Greg
Free VB Add-In - The Reference Librarian
Click Here for screen shot and download link.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|