static public void ResizeObject(ref ResizeInfo R, DateTimePicker dt, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { dt.Location = getLocation(R, dt, sngRow, sngCol); dt.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); dt.Font = ChangeFontSize(dt.Font, R.FS * adjustFont); dt.TabIndex = ++R.tabIndex; }
static public void ResizeObject(ref ResizeInfo R, ProgressBar pb, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { pb.Location = getLocation(R, pb, sngRow, sngCol); pb.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); pb.Font = ChangeFontSize(pb.Font, R.FS * adjustFont); pb.TabIndex = ++R.tabIndex; }
static public void ResizeObject(ref ResizeInfo R, Button b, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { b.Location = getLocation(R, b, sngRow, sngCol); b.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); b.Font = ChangeFontSize(b.Font, R.FS * adjustFont); if (R.setTabIndex) { b.TabIndex = ++R.tabIndex; } }
static public void ResizeObject(ref ResizeInfo R, ListBox l, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 0.8f) { l.Location = getLocation(R, l, sngRow, sngCol); l.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); l.Font = ChangeFontSize(l.Font, R.FS * adjustFont); l.ItemHeight = l.Font.Height; if (R.setTabIndex) { l.TabIndex = ++R.tabIndex; } }
static Point getLocation(ResizeInfo R, Control c, float nRow, float nCol) { Point result; if (c.Parent.GetType().Equals(typeof(TabPage))) { result = new System.Drawing.Point((int)(nCol * R.W), (int)(nRow * R.H + R.offset)); } else { result = new System.Drawing.Point((int)(nCol * R.W), (int)(nRow * R.H)); } return(result); }
static public void ResizeObject(ref ResizeInfo R, TextBox t, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { t.Location = getLocation(R, t, sngRow, sngCol); t.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); t.Font = ChangeFontSize(t.Font, R.FS * adjustFont); if (R.setTabIndex) { if (t.ReadOnly) { t.TabStop = false; } else { t.TabIndex = ++R.tabIndex; } } }
// Allow the form to run on any screen size and resolution private void IJPTest_Resize(object sender, EventArgs e) { // // Avoid resize before Program Load has run or on screen minimize if (initComplete && ClientRectangle.Height > 0) { // this.SuspendLayout(); // Build local parameter R = Utils.InitializeResize(this, 60, 40, true); Utils.ResizeObject(ref R, ipAddressTextBox, 1, 1, 2, 5); Utils.ResizeObject(ref R, cmdConnect, 1, 6.5f, 2, 3.5f); Utils.ResizeObject(ref R, cmdComOn, 1, 10.5f, 2, 3.5f); Utils.ResizeObject(ref R, cmdComOff, 1, 14.5f, 2, 3.5f); Utils.ResizeObject(ref R, lblMessageFolder, 0.5f, 18, 2, 5); Utils.ResizeObject(ref R, txtMessageFolder, 0.5f, 23, 2, 11); Utils.ResizeObject(ref R, cmdMsgBrowse, 0.5f, 35, 2, 4); Utils.ResizeObject(ref R, lblLogFolder, 3, 18, 2, 5); Utils.ResizeObject(ref R, txtLogFolder, 3, 23, 2, 11); Utils.ResizeObject(ref R, cmdLogBrowse, 3, 35, 2, 4); Utils.ResizeObject(ref R, tclIJPLib, 5, 1, 43, 33); Utils.ResizeObject(ref R, cmdClear, 7, 35, 2, 4); Utils.ResizeObject(ref R, cmdNewMessage, 10, 35, 2, 4); Utils.ResizeObject(ref R, cmdGetMessage, 13, 35, 2, 4); Utils.ResizeObject(ref R, cmdGetXML, 16, 35, 2, 4); Utils.ResizeObject(ref R, cmdGetViews, 19, 35, 2, 4); Utils.ResizeObject(ref R, cmdSaveAs, 22, 35, 2, 4); Utils.ResizeObject(ref R, cmdSend, 25, 35, 2, 4); Utils.ResizeObject(ref R, cmdCancel, 28, 35, 2, 4); Utils.ResizeObject(ref R, txtIjpIndented, 1, 1, 38, 31); Utils.ResizeObject(ref R, tvIJPLibTree, 1, 1, 38, 31); Utils.ResizeObject(ref R, txtXMLIndented, 1, 1, 38, 31); Utils.ResizeObject(ref R, tvXMLTree, 1, 1, 38, 31); Utils.ResizeObject(ref R, lblFolderDirectory, 1, 1, 2, 8); Utils.ResizeObject(ref R, dgFolder, 3, 1, 36, 8); Utils.ResizeObject(ref R, cmdSaveInPrinter, 3, 9.5f, 2, 4); Utils.ResizeObject(ref R, lblPrinterDirectory, 1, 14, 2, 14); Utils.ResizeObject(ref R, dgDirectory, 3, 14, 36, 14); Utils.ResizeObject(ref R, cmdGetDirectory, 3, 28.5f, 2, 4); Utils.ResizeObject(ref R, cmdGetOne, 6, 28.5f, 2, 4); Utils.ResizeObject(ref R, cmdGetAll, 9, 28.5f, 2, 4); Utils.ResizeObject(ref R, lblAlarms, 1, 1, 2, 27); Utils.ResizeObject(ref R, dgAlarms, 3, 1, 36, 27); Utils.ResizeObject(ref R, cmdGetAlarms, 3, 28.5f, 2, 4); Utils.ResizeObject(ref R, lblMiscIndented, 1, 1, 2, 13); Utils.ResizeObject(ref R, txtMisc, 3, 1, 36, 13); Utils.ResizeObject(ref R, lblMiscTreeView, 1, 15, 2, 13); Utils.ResizeObject(ref R, tvMisc, 3, 15, 36, 13); Utils.ResizeObject(ref R, lblSelect, 1, 28.5f, 2, 4); Utils.ResizeObject(ref R, cbMiscOps, 3, 28.5f, 2, 4); Utils.ResizeObject(ref R, cmdGetMisc, 6, 28.5f, 2, 4); Utils.ResizeObject(ref R, lstLogs, 50, 1, 9, 15); Utils.ResizeObject(ref R, cmdTest1, 50, 17, 3, 5); Utils.ResizeObject(ref R, cmdTest2, 55, 17, 3, 5); Utils.ResizeObject(ref R, lblSelectXMLTest, 50, 24, 2, 10); Utils.ResizeObject(ref R, cbSelectXMLTest, 52, 24, 2, 10); Utils.ResizeObject(ref R, cmdRunXMLTest, 55, 24, 3, 10); this.ResumeLayout(); } }
static public void ResizeObject(ref ResizeInfo R, Label l, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { l.Location = getLocation(R, l, sngRow, sngCol); l.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); l.Font = ChangeFontSize(l.Font, R.FS * adjustFont); }
static public void ResizeObject(ref ResizeInfo R, TabControl t, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { t.Location = getLocation(R, t, sngRow, sngCol); t.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); t.Font = ChangeFontSize(t.Font, R.FS * adjustFont); }
static public void ResizeObject(ref ResizeInfo R, TreeView tv, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { tv.Location = getLocation(R, tv, sngRow, sngCol); tv.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); }
static public void ResizeObject(ref ResizeInfo R, DataGridView dg, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { dg.Location = getLocation(R, dg, sngRow, sngCol); dg.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); dg.Font = ChangeFontSize(dg.Font, R.FS * adjustFont); }
static public void ResizeObject(ref ResizeInfo R, HScrollBar h, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { h.Location = getLocation(R, h, sngRow, sngCol); h.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); }
static public void ResizeObject(ref ResizeInfo R, PictureBox p, float sngRow, float sngCol, float sngNRows, float sngNCols, float adjustFont = 1) { p.Location = getLocation(R, p, sngRow, sngCol); p.Size = new System.Drawing.Size((int)(sngNCols * R.W), (int)(sngNRows * R.H)); }