Example #1
0
        static public xLabel createMultiLineLabel(string text, Font f, int w)
        {
            xLabel l  = new xLabel();
            Label  _l = new Label();

            //  calc height of text
            int tw    = utils.Utils.getStringW(text, f) + 10;
            int lines = tw / w;

            if (lines < 1)
            {
                lines = 1;
            }
            if (tw - lines * w > 0)
            {
                lines++;
            }

            _l.Font = f;
            _l.Size = new Size(w, lines * f.Height);
            _l.Text = text;
            l.setControl(_l);

            return(l);
        }
Example #2
0
        static public xLabel createMultiLineLabel(string text, int w)
        {
            xLabel l  = new xLabel();
            Label  _l = new Label();

            _l.Size = new Size(w, _l.Size.Height);
            _l.Text = text;
            l.setControl(_l);

            return(l);
        }