|
-
Jun 7th, 2008, 05:46 PM
#1
Thread Starter
Junior Member
[2008] How to change BackColor with RGB
Code:
PictureBox1.BackColor = New BackColor(RGB(TextBox1.Text, TextBox2.Text, TextBox3.Text))
I've tried a lot of different ways, and this one is the closest, but it gives the error "Type 'BackColor' is not defined" for "New BackColor(RGB"
-
Jun 7th, 2008, 05:49 PM
#2
Re: [2008] How to change BackColor with RGB
Check what type the BackColor property is, using the intellisense.
Now that you know it is of type Color, you understand that you must assign a Color to it. The Color structure has a method called FromArgb, that you'll need to make use of.
-
Jun 7th, 2008, 05:54 PM
#3
Thread Starter
Junior Member
Re: [2008] How to change BackColor with RGB
Could you give an example?
-
Jun 7th, 2008, 05:56 PM
#4
Re: [2008] How to change BackColor with RGB
What I've said should really be sufficient. If you just type in Color.FromArgb( in your code intellisense will tell you all you need to know about the method. Should you still be confused there's always MSDN to help you out. Its always a good thing to learn how to use.
-
Jun 7th, 2008, 06:07 PM
#5
Thread Starter
Junior Member
Re: [2008] How to change BackColor with RGB
I've seen more helpful advise from a PAWN scripting forum. You are very annoying. You expect beginners to know what you mean in a language that they don't understand.
What the hell is MSDN, what the hell does FromArgb mean, and how the hell does the code snippet go togeather? Is it "PictureBox1.BackColor.FromArgb(RGB(TextBox1.Text, TextBox2.Text, TextBox3.Text))" or is it "PictureBox1.BackColor.FromArgb = New BackColor.FromArgb(RGB(TextBox1.Text, TextBox2.Text, TextBox3.Text))" or what the hell is it?!
If you don't understand what I mean, don't try to help me, because it won't work. I don't understand the structure of windows programing yet.
-
Jun 7th, 2008, 06:35 PM
#6
Re: [2008] How to change BackColor with RGB
Well you certainly do not need to get personal about it. But thats fine, now I know how you feel, I shallnt be helping you no more.
-
Jun 7th, 2008, 06:55 PM
#7
Re: [2008] How to change BackColor with RGB
color.fromargb
from alpha red green blue
alpha = 0-255 - color transparency
red = red 0-255
green = green 0-255
blue = blue 0-255
does that help?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 7th, 2008, 07:02 PM
#8
Re: [2008] How to change BackColor with RGB
vb Code:
PictureBox1.BackColor = Color.FromArgb(cint(TextBox1.Text), cint(TextBox2.Text), cint(TextBox3.Text))
as atheist said, use the code editors intellisense to check the overloads, by typing Color.FromArgb( you'll be presented with a list of possible overloads, from which you can choose the most applicable one.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
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
|