Control ResourceKeyEditor(bool enabled, string name, ref int tabIndex, ObjKeyResource.ObjKeyResource.ComponentDataType cdt) { ObjKeyResource.ObjKeyResource.CDTResourceKey cdtResourceKey = cdt as ObjKeyResource.ObjKeyResource.CDTResourceKey; Label lb = new Label(); lb.AutoSize = true; lb.Text = "(WWWW) 0xDDDDDDDD-0xDDDDDDDD-0xDDDDDDDDDDDDDDDD"; TGIBlockCombo tbc = new TGIBlockCombo(objk.TGIBlocks, cdtResourceKey == null ? -1 : cdtResourceKey.Data, false); tbc.Anchor = AnchorStyles.Left; tbc.Enabled = enabled; tbc.Name = "tbc" + name; tbc.TabIndex = tabIndex++; tbc.Width = lb.PreferredWidth; tbc.TGIBlockListChanged += new EventHandler(tbc_TGIBlockListChanged); return tbc; }
void AddTableRowTBC(TableLayoutPanel tlp, int entry, int index, ref int tabindex) { tlp.RowCount++; tlp.RowStyles.Insert(tlp.RowCount - 2, new RowStyle(SizeType.AutoSize)); Label lb = new Label(); TGIBlockCombo tbc = new TGIBlockCombo(vpxy.TGIBlocks, index, false); lb.AutoSize = true; lb.BorderStyle = BorderStyle.Fixed3D; lb.Dock = DockStyle.Fill; lb.FlatStyle = FlatStyle.Standard; lb.Margin = new Padding(0); lb.Name = "lbEntry" + tabindex; lb.TabIndex++; lb.Text = entry.ToString("X"); lb.TextAlign = ContentAlignment.MiddleRight; lb.Tag = tbc; lb.Click += new EventHandler(lb_Click); tlp.Controls.Add(lb, 0, tlp.RowCount - 2); tbc.Anchor = AnchorStyles.Left | AnchorStyles.Right; tbc.Name = "tbc" + tabindex; tbc.TabIndex = tabindex++; tbc.Enter += new EventHandler(tbc_Enter); tbc.SelectedIndexChanged += new EventHandler(tbc_SelectedIndexChanged); tlp.Controls.Add(tbc, 2, tlp.RowCount - 2); if (tlp == tlpParts) ltbc.Add(tbc); else lLPtbc.Add(tbc); tbc.Focus(); tbc.TGIBlockListChanged += new EventHandler(tbg_TGIBlockListChanged); }