I have an implementation question. I am trying to have a rectangle change color based on the position of four sliders. (Alpha, Red, Green, Blue) I am attempting to use a dependency property to combine all four values, convert them to a brush, and apply the brush to a rectangle. First question is, is it possible to do this with one property? If not, do I need a property for each slider and a property that is accessed each time one of the sliders change?
tylerjgarland
0
Newbie Poster
Recommended Answers
Jump to Postyou could have a color property. when you adjust a slider just update that component of the color property
private void redTB_Scroll(object sender, EventArgs e) { m_red = redTB.Value; colorBox.BackColor = Color.FromArgb(m_alpha, m_red, m_green, m_blue); } private void GreenTB_Scroll(object sender, EventArgs e) { m_green = GreenTB.Value; colorBox.BackColor …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.