PosControlException: Failed to set property MarqueeType

430 views Asked by At

I am trying to Scroll a text in my pole display. My pole display model is CD7220 But I am getting a PosControlException message "Failed to set property MarqueeType."

here is the code i use

LineDisplay lineDisplay;
        PosExplorer explorer;
        try
        {

            explorer = new PosExplorer();
            DeviceCollection devColl = explorer.GetDevices(DeviceType.LineDisplay);
            if (devColl == null || devColl.Count <= 0)
            {
                Console.WriteLine("Device not found");
                return;
            }

            DeviceInfo device = explorer.GetDevice("LineDisplay", "CD7220");
            lineDisplay = (LineDisplay)explorer.CreateInstance(device);
             lineDisplay.Open();

            lineDisplay.Claim(1000);

            lineDisplay.DeviceEnabled = true;


            string s = "Welcome to ovelco food city!";
            int wWindth = s.Length + 20;

            lineDisplay.CreateWindow(0, 0, 1, 20, 1, wWindth);
            lineDisplay.DisplayText(s);
            lineDisplay.MarqueeType = DisplayMarqueeType.Left;
            lineDisplay.MarqueeUnitWait = 200; 
            lineDisplay.MarqueeFormat = DisplayMarqueeFormat.Walk;

            Console.ReadKey();
            lineDisplay.ClearText();
            lineDisplay.Release();
            lineDisplay.Close();

        }
        catch (Exception e)
        {
            //  MessageBox.Show(e.Message);
            Console.WriteLine(e.Message);
        }

how to fix this issue and scroll a text in pole display perfectly ?

Thanks in advance.

1

There are 1 answers

0
John Deters On

According to Unified POS docs, you will get an error setting the MarqueeType property to "left" unless the CapHMarquee property is true, (and your window width is greater than your columns, which it is). Write a test to show the value of CapHMarquee; perhaps your particular device doesn't support it?