How to change Label text ComboBox Selected Items



  • How to change Label text with ComboBox Items ?

    Any help please?

    HiseSnippet 882.3ocsV0tSaCCE0tTyng0IPZO.QUZREIFJcC1lzzz5ZKcpZ7Q0JCw+PtItTKbr6RbXTgPZOx6AXRaWmj1jBEFTok9md+3by4Ze70oafxkEFpBP3RGMdDCgeJo2XodXygTtD0oEB+Lx9zPMKvNwUiwinggLODFuzmMNvkJhhe90GaPEToKKyEBcrh6x1i6y0Yd6V+KbgnM0icD2OW1aWuiqR1TITQ.eVh3fFQcOmdF6.pIsBDDd4c83ZUPOMUyBgbZn7F2an5Gxj7OlGx6KXFiZndPgRbiZNjK75NoWCQHbwtYc9RIc9yI6y83S8msBrVb.6LD4WCvElkREmgR0tKJ0VI7LE3NnGNG8JlPu0I8bC3izYQLbaURGIr4LfBK64oURtnB+FSZpfLj5s7omyZG.FSQTcGGmMs21wYi2W1prEr3GpsufBa0J+9pFpKqY+A6IvOioA2iTRvnZkoYT4lX2i1mItafIgSQY9wkBtjYOHR5p4JosQAjVaSEBThptSfuI7FDQrMJacUYKa.rM7b+umsBYfklcotxlUhesWG+p+mskAXJAZREh9fTr5s4lof4n9AJM6PY0Mrtxpj00V12LzfAyMVZwDrf4F1bLI39.VUF42mELY4YRhf1YVw4pOLwoaxZStDUxNRt9vQrT6L4qIVRWOIpCZZyl2UVOl2abqMmzxbc6SGnz8N3eeqSKplZNvj5CxaDKPyMcKtE6BX5SxwmRjVrvy0pQvfjoa3HLQGGsb5gqXUChCc1JjDED5xoCn942qONaZ090Mhp3wRnbE7IIEbszBNQuDWyUISkO4JK7LN+TTtl4Cr+EjtbpTY0VDoY1VMBfy1V8zAb4YgVcodgVsOwB4SgBQvKCHCoWv5H6Fv.gqYD.51yPfIYJuHAUO63Myb7z.frZl4HlYExPtdFF9Hl44L2Yd0l2t5CjtqCqKZ2gymuElCeA0w+a9ldCRYxtCFvb0YjsHo8IK50EOBp7UUjFzE6SA4gQObPjeO3RTWFvDojIBMZjBlSNI1NFayJSOlzK13OvSZvZFabZvZSBBJM2.0otIGOM2QsRrGfSx3qmKAem.XaWCEODBvQb1xA4CWcdpqqYo3k.2mOlWs.Xd8BfY6E.yNK.l2r.Xd6Bf4c2KFyWs7oHsxO4XB3n6twiKw3ckTPkEqHQ+EPWrh6b
    


  • @Tania-Ghosh Use Switch Case

    e.g

    inline function onComboBox1Control(component, value)
    {
       switch (value)
        {
            case 1:
     Content.getComponent("Label1").set("text","Piano");
                
            case 2: 
     Content.getComponent("Label1").set("text","Flute");
        }
       
    };
    


  • @Tania-Ghosh How did you forget basic things? You are not studying well anymore !!



  • @Rudra-Ghosh Oooops !! Sorry 😰



  • @Tania-Ghosh I would do it like this:

    inline function onComboBox1Control(component, value)
    {
     
        Content.getComponent("Label1").set("text", component.getItemText());
    };
    
    Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
    


  • @ulrik 👍 Easier... Thank you 🙂

    Then how would I customize the Label Text. example:

    ComboBox
    Piano
    Flute
    etc

    Selected Label Text will be : " Yamaha C7 Grand"
    " Indian Native Flute"
    .........

    How?



  • @Rudra-Ghosh
    Give the names in combo boxs property 🙃



  • @Tania-Ghosh are you saying that in the Combobox you will have like:
    "piano" but you want the label to display "Yamaha C7 Grand"?

    in that case I would use @Rudra-Ghosh switch example

    like:

    inline function onComboBox1Control(component, value)
    {
       switch (value)
        {
            case 1:
     Content.getComponent("Label1").set("text"," Yamaha C7 Grand");
                
            case 2: 
     Content.getComponent("Label1").set("text","Indian Native Flute");
        }
       etc...
    };
    


  • @ulrik Yeah.. That's what I want. 👍


Log in to reply
 

16
Online

1.2k
Users

3.9k
Topics

34.1k
Posts