OLE_Color Type

Staminos
Member Posts: 68
Hi,
I try to use method ShowColor from Common Dialog.
Afterwards, I try to get the selected Color with the property Color which is a OLE_Color variable type.
But how can we declare an OLE_COLOR variable in Navision ?
I try to use method ShowColor from Common Dialog.
Afterwards, I try to get the selected Color with the property Color which is a OLE_Color variable type.
But how can we declare an OLE_COLOR variable in Navision ?
0
Answers
-
You can't. LS Retail has a com that does that.0
-
You can use Microsoft Script Control to convert OLE_COLOR to integer
Variables:
VariantVal : Variant
Script: Automation 'Microsoft Script Control 1.0'.ScriptControl"
ColorDialog: OCX 'Microsoft Common Dialog Control, version 6.0'"
ColorValue : Integer
and code:
CREATE(Script);
Script.Language := 'VBScript';
VariantVal := Script.Eval(ColorDialog.Color);
ColorValue := VariantVal;0 -
Thank
It was so easy....
Fingers in the noses !0 -
Has anyone got this working in the Role tailored client ? I get the following error:
"Unable to convert from Microsoft.Dynamics.Nav.Runtime.NavAutomation to System.String."
This is the code that gives the error:
liColor := lautConvColorToInt.Eval(locxCommonDialogControl.Color);
I tried to replace the liColor (integer) with a variant, and this works, but then I can't convert the variant to an integer
Thx,
Andy0 -
I think that it is problem of using OCX on RTC. Do not forget that the automation is created on service tier by default (I am not sure if it is true for OCX too, but for Automation it is true, but you can change it by parameter of CREATE, but this is not used for OCX).0
-
My machine did not have the Script Control installed, for some reason, so I tried to find an alternative solution, as described here: http://mibuso.com/blogs/zenandtheartofc ... og-part-i/.Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
On RTC:
The commonDialog has a .NET wrapper.
Instead of using VB, you write C# like .NET code.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