Esempio n. 1
0
        private List<Control> GetControls(LabelField field, Size canvasSize)
        {
            TransparentLabel label = new TransparentLabel();
            SetControlProperties(label, field, canvasSize);
            label.Text = field.PromptText.Replace("\t","    ");
            label.AutoSize = false;
            label.Name = field.Name;

            if (field.Page.FlipLabelColor)
            {
                label.ForeColor = Color.White;
            }

            List<Control> controls = new List<Control>();
            controls.Add(label);
            if (!fieldControls.ContainsKey(field))
            {
                fieldControls.Add(field, controls);
            }
            else
            {
                fieldControls.Remove(field);
                fieldControls.Add(field, controls);
            }

            field.Control = label;
            return controls;
        }
Esempio n. 2
0
        private TransparentLabel GetPrompt(Control control, FieldWithSeparatePrompt field, Size canvasSize)
        {
            TransparentLabel prompt = new TransparentLabel();
            prompt.AutoSize = true;
            prompt.Font = field.PromptFont;
            prompt.Text = field.PromptText;
            prompt.Left = WinUtil.GetPromptLeft(field, canvasSize.Width);
            prompt.Top = WinUtil.GetPromptTop(field, canvasSize.Height);
            prompt.Visible = field.IsVisible;
            prompt.UseMnemonic = false;

            if (field.Page.FlipLabelColor)
            {
                prompt.ForeColor = Color.White;
            }

            _controlFields.Add(prompt, field);
            return prompt;
        }