private void xapFormControl_Load(object sender, EventArgs e) { model = new OrderConfirmCardViewModel(); model.GetSrvCa("CI.OR.0765"); selectMulty = new XComBoxMulty(bc); //传个父窗体 if (RelativeUIParam.ScreenSize == ScreenSize.Large) { selectMulty.Size = new Size(200, 28); } else { selectMulty.Size = new Size(200, 24); } // selectMulty.SearchCondition += new XComBoxMulty.GetSearchCondition(selectMulty_SearchCondition); var data = new Dictionary <object, string>(); if (model.Udis != null) { foreach (UdidocDO udi in model.Udis) { data.Add(udi.Id_udidoc, udi.Name); } } selectMulty.DataSource = data; var controls = new Dictionary <string, Control>(); bc.AddRender(selectMulty); controls.Add("xiala", bc); bc.SizeChanged += bc_SizeChanged; xapFormControl.RegisterControl(controls); OnFillData(); }
private XapBaseControl getFeeLabelControl(string code, string title, string money, string meadoc, Point location) { XapBaseControl control = new XapBaseControl(); control.Location = location; control.BringToFront(); control.BackColor = Color.Transparent; XLabel titleL = new XLabel(); Font font = new Font(titleL.Font.FontFamily, 15, titleL.Font.Style, GraphicsUnit.Pixel); titleL.Font = font; titleL.Size = new Size(TextRenderer.MeasureText(title, font).Width, nTitleHeight); titleL.Location = new Point(0, 0); titleL.ValueText = title; //titleL.BackColor = Color.Blue; XLabel moneyL = new XLabel(); font = new Font(moneyL.Font.FontFamily, 15, moneyL.Font.Style, GraphicsUnit.Pixel); moneyL.Font = font; moneyL.Size = new Size(TextRenderer.MeasureText(money, font).Width, nTitleHeight); moneyL.Location = new Point(titleL.Bound.Right, 0); moneyL.ValueText = money; moneyL.Name = code; moneyLabelMap.Add(code, moneyL); //moneyL.BackColor = Color.Yellow; XLabel meadocL = new XLabel(); font = new Font(meadocL.Font.FontFamily, 15, meadocL.Font.Style, GraphicsUnit.Pixel); meadocL.Font = font; meadocL.Size = new Size(TextRenderer.MeasureText(meadoc, font).Width, nTitleHeight); meadocL.Location = new Point(moneyL.Bound.Right, 0); meadocL.ValueText = meadoc; //meadocL.BackColor = Color.Green; control.Size = new Size(new Point(titleL.Bound.Width + moneyL.Bound.Width + meadocL.Bound.Width, nTitleHeight)); control.AddRender(titleL); control.AddRender(moneyL); control.AddRender(meadocL); return(control); }
public OrdChildfrm() { xap.mw.serviceframework.NetModule.init(); this.Text = ""; this.Size = new Size(401, 451); //this.TitleHeight = 0; this.Location = new Point(100, 10); // this.DarkEdgeBrush = new SolidBrush(Color.FromArgb(0, 153, 229)); Twoflag = false; btnOk = new XButton(); pannel = new XapBaseControl(); btnOk.Text = "确认"; btnOk.MouseClick += new MouseEventHandler(btnOk_MouseClick); btnOk.Location = new Point(this.Width - btnOk.Size.Width * 2 - 50, this.Size.Height - btnOk.Size.Height - 6); btnCancel = new XButton(); btnCancel.Text = "取消"; btnCancel.MouseClick += new MouseEventHandler(btnCancel_MouseClick); btnCancel.Location = new Point(btnOk.Location.X + btnOk.Size.Width + 25, btnOk.Location.Y); pannel.AddRender(btnOk); pannel.AddRender(btnCancel); pannel.SizeChanged += new EventHandler(pannel_SizeChanged); // this.MouseClick += new MouseEventHandler(OrdChildfrm_MouseClick); pannel.Dock = DockStyle.Fill; pannel.MouseClick += new MouseEventHandler(pannel_MouseClick); pannel.Paint += new PaintEventHandler(Panel_Paint); pannel.BackColor = Color.FromArgb(240, 240, 240); this.Panel = pannel; this.model = new OrdChildfrmModel(); DeptDO dept = UserManager.getInstance().CurrentDept; selectBrush = new SolidBrush(Color.FromArgb(0, 153, 229)); moveBrush = new SolidBrush(Color.FromArgb(210, 245, 255)); first = this.model.getOrdInputDto(null, null); // Thread = this.model.getSrvOrTplItemDO(Second[1].Id_srvortpl); loaddata(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Text = "HpIndicDocJudgeForm"; this.components = new System.ComponentModel.Container(); //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; xLayoutPanel = new XLayoutPanel(); this.xLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.xLayoutPanel.Location = new System.Drawing.Point(5, 37); this.xLayoutPanel.CenterPadding = "10,0,0,0"; buttonControl = new XapBaseControl(); saveButton = new XButton { Size = new Size(90, 25), Text = "确认" }; saveButton.Location = new Point(this.Bounds.Width - 120, 0); buttonControl.AddRender(saveButton); xLayoutPanel.AddControl(buttonControl, ControlPosition.Bottom, 35); this.AddRender(xLayoutPanel); //lblDes.Size = lblDes.GetPreferredSize(new Size(this.Width - 30, 60)); this.StartPosition = FormStartPosition.CenterScreen; }