Create Colour Picker Lookup in AX 2012 using X++



Below is the small piece of code that may help you to create 
Add "IntEdit" control to the form and in the lookup method of it write below code.

public void lookup()
{
    #DEFINE.COLORVALUE(64)
    Int r,g,b;
    container chosenColor;
    Binary customcolors = new Binary(#COLORVALUE);
    CCColor colorvalue;

    Super();

    [r,g,b] = WinAPI::RGBint2Con(this.backgroundColor());

    chosenColor = WinAPI::chooseColor(element.hWnd(),r,g,b, customColors, true);

    If(chosencolor)
    {
        [r, g, b] = chosencolor;
        Colorvalue = WinAPI::RGB2int(r,g,b);
        This.backgroundColor(colorValue);
    }
}

Previous
Next Post »

1 comments:

Write comments
Anonymous
AUTHOR
31 January 2022 at 23:06 delete

The Best Slots Casino Sites UK | LuckyClub
A comprehensive guide to all luckyclub slots games, jackpots, jackpots and more | Play Slots online now at our #1 casino. Welcome bonus up to £100 & 100 free spins!

Reply
avatar