InterviewSolution
Saved Bookmarks
| 1. |
Solve : Microsoft VB (Word 2003)? |
|
Answer» I'm working with MSWord2003's vb and I was wondering how I could change a label's colour depending on how high a slider is set, 100 to deep red, 0 to green, and fade between them (50 is some kind of red/green colour).more details please. it's VBA, by the way.Manually? It's out of 100. Is there a way that uses the value to create a colour CODE? And it's Microsoft Visual Basic. PRESS alt+f11 and see. Quote And it's Microsoft Visual Basic. Press alt+f11 and see. No. It isn't. It's Visual Basic for Applications. Just because it says "Microsoft Visual Basic" in the title-bar for the Visual Basic editor doesn't mean a thing. I, unlike you, know the history of both VB and VBA, as well as the macro languages that came before it. Visual Basic is a separate product entirely, and is part of Visual Studio, not Microsoft Office. Quote Manually? It's out of 100. Is there a way that uses the value to create a colour code?yes. it's called basic arithmetic. Combining red and green?yes. basic arithmetic. recall the RGB function takes a Red,Green, and a blue value and returns a packed 32-bit integer, which you can use when setting the color of a control. the idea is to MAKE the red and green based on the slider position. assuming red is 0 and green is 100. Code: [Select]Red = (Slider.Value/100)*255 Green = 255-Red and then you use those two in a RGB function. |
|