简体   繁体   中英

PosControlException: Failed to set property MarqueeType

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM