Control Runtime Colors

David_Ferreira
Member Posts: 6
Hello, I'm new at this so dont laugh too hard,
I've just created an Indicator control that will display a changing amount during runtime, this works, however I also want to change the color of the Gauge bar during runtime, acoording to the value in the srcexp... I have set a case of ranges which can distinguish which color should be used... but how do you change the color during runtime???
i figure it would be something like:
CURRFORM.<CONTROLNAME>.<Format Forecolor(#####)> does anyone know how to do this?
thanks for our help.
Dave.
I've just created an Indicator control that will display a changing amount during runtime, this works, however I also want to change the color of the Gauge bar during runtime, acoording to the value in the srcexp... I have set a case of ranges which can distinguish which color should be used... but how do you change the color during runtime???
i figure it would be something like:
CURRFORM.<CONTROLNAME>.<Format Forecolor(#####)> does anyone know how to do this?
thanks for our help.
Dave.
0
Comments
-
Use [CurrForm."Your control".]UPDATEFORECOLOR(RGB color value) for this, which function is callable only in the OnFormat trigger of the control. RGB color values can be found by selecting the desired color from the colorbox in the Toolbar as forecolor of the control, then copy the number to your routine.
John0 -
Befor you do that, make sure you set the name property of the indicator.
If you don't, Navision will not recognize the control.
..Check this by pressing F5 in your C/Al editor.
Select CurrForm....Controls.
You will only find your indicater if you named it yourself.
0 -
Thanks guys, Though I couldnt get it to do what I ultimately wanted to, it doesnt matter anyway it was just something that I was trying to work out on my own leisure.
Your tips helped though, but the Indicator(gauge control) doesnt have the forecolor property on runtime... so I couldnt change it, unless I changed the color before and just keep it that color.
either way, thanks for your help guys.
Much appreciated.
Dave.0 -
A bit tricky, perhaps, but you can get reach a change in color by putting two (or three) Indicator controls on top of each other, each having a different color. As long as the counter is within a certain range, you make one of the indicators visible.
John0 -
Could you not use the CurrForm.UPDATE;
This would re run-the Format property
If (condition = 100)or(condition = 200)or(condition = 300)Then
CurrForm.UPDATE;
Onformat trigger code change the font colour base on the condition.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions