public ucReplyIssue(Form parentForm, long ID, long Nguoi_gui, DateTime Thoi_gian_gui, object Bytes_Noi_dung, DataSet dsListFile, string FieldFileName, string FieldNoiDung,long TinhTrang,params string[] ThongTinVanDe) { InitializeComponent(); this._ID = ID; this.parentForm = parentForm; this.FieldFileName = FieldFileName; this.FieldNoiDung = FieldNoiDung; //Tình trạng là hoàn tất thì không cho chỉnh sửa. btnUpdate.Visible = TinhTrang == 3 ? false : true; UpdateContent(Nguoi_gui, Thoi_gian_gui, Bytes_Noi_dung, dsListFile, FieldFileName, FieldNoiDung); if (ThongTinVanDe.Length > 0) { groupControl1.Text = ThongTinVanDe[0]; groupControl1.ShowCaption = true; lblTinhTrang.Text = ThongTinVanDe[1]; btnDelete.Tag = "Delete_Issue"; } else { btnDelete.Tag = "Delete_ReplyOfIssue"; groupControl1.ShowCaption = false; } richVSrollBar = GetVScrollBar(richEditContent); richEditContent.DocumentLoaded += new EventHandler(richEditContent_DocumentLoaded); }
public ucReply(Form parentForm, long ID, long Nguoi_gui, string nguoiHoTro, DateTime Thoi_gian_gui, object Bytes_Noi_dung, DataSet dsListFile, string FieldFileName, string FieldNoiDung, long TinhTrang, params string[] ThongTinYC) { InitializeComponent(); this._ID = ID; this.parentForm = parentForm; this.FieldFileName = FieldFileName; this.FieldNoiDung = FieldNoiDung; if (dtNhanVien == null) dtNhanVien = HelpDB.getDatabase().LoadDataSet("SELECT * FROM DM_NHAN_VIEN WHERE VISIBLE_BIT = 'Y'").Tables[0]; //Tình trạng là hoàn tất thì không cho chỉnh sửa. btnUpdate.Visible = TinhTrang == 4 ? false : true; UpdateContent(Nguoi_gui, nguoiHoTro, Thoi_gian_gui, Bytes_Noi_dung, dsListFile, FieldFileName, FieldNoiDung); if (ThongTinYC.Length > 0) { groupControl1.Text = ThongTinYC[0]; groupControl1.ShowCaption = true; lblTinhTrang.Text = ThongTinYC[1]; btnDelete.Tag = "Delete_Support"; } else { btnDelete.Tag = "Delete_ReplyOfSupport"; groupControl1.ShowCaption = false; } richVSrollBar = GetVScrollBar(richEditContent); richEditContent.DocumentLoaded += new EventHandler(richEditContent_DocumentLoaded); }
public ucBaiViet(Form parentForm, long NguoiTaoBaiVietGoc, DOBaiViet doBaiViet) { InitializeComponent(); this.parentForm = parentForm; this.doBaiViet = doBaiViet; this.NguoiTaoBaiVietGoc = NguoiTaoBaiVietGoc; lblNguoi_gui.Text = DMFWNhanVien.GetFullName(doBaiViet.NGUOI_GUI); lblThoiGian.Text = doBaiViet.NGAY_GUI.ToString(PLConst.FORMAT_DATETIME_STRING); richVSrollBar = GetVScrollBar(richEditContent); UpdateContent(doBaiViet.NOI_DUNG, doBaiViet.DSTapTinDinhKem); }
private void CreateVerticalScrollBar() { if (vScroll != null) { return; } vScroll = new DevExpress.XtraEditors.VScrollBar(); vScroll.Parent = this; vScroll.ScrollBarAutoSize = true; vScroll.Scroll += OnVerticalScroll; vScroll.HandleCreated += OnScrollBarHandleCreated; }
public ItemSelectorPopupForm(ItemSelector owner) : base(owner) { base.fCloseButtonStyle = BlobCloseButtonStyle.None; ScrollBar = new DevExpress.XtraEditors.VScrollBar(); ScrollBar.ScrollBarAutoSize = true; ScrollBar.Scroll += ScrollBar_Scroll; ScrollBar.LookAndFeel.Assign(Properties.LookAndFeel); Controls.Add(ScrollBar); dragScrollTimer = new Timer(); dragScrollTimer.Tick += DragScrollTimer_Tick; }
private void Pc_Resize(object sender, EventArgs e) { PanelControl pc = sender as PanelControl; DevExpress.XtraEditors.VScrollBar VSsr = pc.Controls[0] as DevExpress.XtraEditors.VScrollBar; PanelControl pc1 = VSsr.Tag as PanelControl; if (pc1 != null) { pc1.Width = pc.Width - VSsr.Width; } VSsr.Maximum = (int)(pc1.Controls.Count / (int)(pc1.Width / 120)) + 1; pc1.Height = 100 * VSsr.Maximum; }
public MyPanelControl() { _vScroll = new VScrollBar { Dock = DockStyle.Right, Size = new Size(0, 0), Visible = true, Maximum = 100, Margin = new Padding(0), Padding = new Padding(0) }; _vScroll.Scroll += v_Scroll; _vScroll.ValueChanged += vScroll_ValueChanged; this.Controls.Add(_vScroll); _dgv = new MyDgv(); }
/// <summary> /// Setup the scrollbar for the current trellis paging values /// </summary> internal void SetupScrollBar() { if (ChartPanel == null || ChartPanel.ChartPagePanel == null) { return; } DevExpress.XtraEditors.VScrollBar sb = ScrollBar; //if (ChartEx.TrellisByRowCol) //{ if (TrellisPageCount <= 1) { sb.Visible = false; return; } if (!sb.Visible) { sb.Location = new Point(this.Width - (sb.Width + 1), 36); // adjust size & location sb.Height = this.Height - (sb.Top + 1); sb.Visible = true; } bool saveIs = ChartPagePanel.Insetup; ChartPagePanel.Insetup = true; sb.Minimum = 0; sb.Maximum = TrellisPageCount - 1; sb.SmallChange = 1; sb.LargeChange = 1; sb.Value = TrellisPage; ChartPagePanel.Insetup = saveIs; sb.Refresh(); //} //else // trellis by flow //{ // // todo //} return; }
private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //this.splitContainerControl.Panel2.Controls.Clear(); //pnMain.Controls.Clear(); ClearControls(); var form = new frmInspect(); form.TopLevel = false; form.FormBorderStyle = FormBorderStyle.None; form.Dock = DockStyle.Top; DevExpress.XtraEditors.VScrollBar vs1 = new DevExpress.XtraEditors.VScrollBar(); vs1.Dock = DockStyle.Right; //pnMain.Controls.Add(vs1); // splitContainerControl.Panel2.Controls.Add(form); pnMain.Controls.Add(form); pnMain.AutoScroll = true; form.Show(); }
public BvScrollableControl() { WindowsFormsSettings.SmartMouseWheelProcessing = true; InitializeComponent(); if (Localizer.IsRtl) { Margin = new Padding(0); Padding = new Padding(0); m_VScroll = new VScrollBar { RightToLeft = RightToLeft.No, Dock = DockStyle.Left, SmallChange = 5, Parent = this }; VerticalScroll.Visible = false; m_Container = new XtraScrollableControl(); m_Container.Parent = this; m_Container.Location = new Point(0, 0); m_Container.ClientSize = ClientSize; //m_Container.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; m_VScroll.Scroll += ScrollVertically; //ParentChanged += SetParent; Resize += ResizeMe; //m_VScroll.GotFocus += ScrollGotFocus; //m_VScroll.MouseUp += ScrollGotFocus; m_Container.MouseWheel += OnMouseWheel; //m_VScroll.MouseWheel += OnMouseWheel; MouseWheel += OnMouseWheel; } //else //{ // m_Container.Visible = false; // m_VScroll.Visible = false; //} }
private void Khoitao() { dmkh = DataFactory.publicCDTData.findCDTData("DMKH", "", ""); if (dmkh == null) { dmkh = DataFactory.DataFactory.Create(CDTControl.DataType.Single, "DMKH", Config.GetValue("sysPackageID").ToString()) as DataSingle; DataFactory.publicCDTData.AddCDTData(dmkh); dmkh.GetData(); } this.grdmkh.Properties.DataSource = dmkh.DsData.Tables[0]; // grdmkh.EditValue = _cban.MaKH; string sql = "select mamon, tenmon, giaban, hinh, maloaimon from dmmon where mamon in (select mamon from dmmon4area where MaPOSArea='" + MaPOSArea + "')"; tbMon = db.GetDataTable(sql); sql = "select maloaimon from dmmon where mamon in (select mamon from dmmon4area where MaPOSArea='" + MaPOSArea + "')"; sql = "select maloaimon, tenloaimon from dmloaimon where maloaimon in (" + sql + ")"; tbLoaiMon = db.GetDataTable(sql); repositoryItemGridLookUpEdit1.DataSource = tbMon; pcLoaiMon.Visible = true; panelControl1.Controls.Add(pcLoaiMon); pcLoaiMon.Width = 10; pcLoaiMon.Height = panelControl1.Height; int x = 0; pcLoaiMon.Left = sLeft.Width; foreach (DataRow drLM in tbLoaiMon.Rows) { SimpleButton sp = new SimpleButton(); sp.Text = drLM["tenloaimon"].ToString(); sp.Tag = drLM["maloaimon"].ToString(); sp.Width = 100; sp.Height = pcLoaiMon.Height; sp.Font = new Font("Times New Roman", 10, FontStyle.Bold); sp.ForeColor = Color.Firebrick; sp.Left = x; sp.Top = 0; x += sp.Width; pcLoaiMon.Controls.Add(sp); pcLoaiMon.Width += sp.Width; sp.Click += new EventHandler(sp_Click); //Khởi tạo món DataRow[] ldrMon = tbMon.Select("maloaimon='" + sp.Tag.ToString() + "'"); PanelControl pc = new PanelControl(); pc.Text = sp.Tag.ToString(); pc.Visible = true; this.Controls.Add(pc); pc.BringToFront(); pc.Dock = DockStyle.Fill; lpc.Add(pc); PanelControl pc1 = new PanelControl(); DevExpress.XtraEditors.VScrollBar VSsr = new DevExpress.XtraEditors.VScrollBar(); VSsr.Minimum = 0; VSsr.Maximum = 1; VSsr.LargeChange = 1; VSsr.Scroll += VSsr_Scroll; pc.Controls.Add(VSsr); VSsr.Dock = DockStyle.Right; pc.Resize += Pc_Resize; pc1.Width = pc.Width - VSsr.Width; pc1.Top = 0; pc1.Left = 0; VSsr.Tag = pc1; pc1.Height = 100; pc.Controls.Add(pc1); int xt = 0; int yt = 0; foreach (DataRow drMon in ldrMon) { cMon sb = new cMon(drMon); pc1.Controls.Add(sb); pc1.Resize += Pc1_Resize; sb.Chonmon += new EventHandler(sb_Click); } } }
public Rectangle CalcPopupRect(Rectangle filterButtonRect) { Rectangle popupRect = new Rectangle(); int maxWidth = 0; int maxHeight = 0; Graphics graphics = this.CreateGraphics(); int itemHeight = (int)Math.Round(graphics.MeasureString("0", this.filterItemsList.Font).Height) + 3; for (int i = 0; i < this.filterItemsList.ItemCount; i++) { SizeF szText = graphics.MeasureString(this.filterItemsList.Items[i].ToString(), this.filterItemsList.Font); int itemWidth = (int)Math.Round(szText.Width); if (itemWidth > maxWidth) { maxWidth = itemWidth; } if (i < 20) { maxHeight += itemHeight; } } maxWidth += 10; if (maxWidth > ownerTreeList.Width / 2) { maxWidth = ownerTreeList.Width / 2; } DevExpress.XtraEditors.VScrollBar vScroll = new DevExpress.XtraEditors.VScrollBar(); int vScrollWidth = vScroll.Width; vScroll.Dispose(); if (itemHeight * this.filterItemsList.ItemCount > maxHeight) { maxWidth += vScrollWidth; } popupRect.X = filterButtonRect.X; popupRect.Y = filterButtonRect.Bottom; popupRect.Location = ownerTreeList.PointToScreen(popupRect.Location); popupRect.Width = maxWidth; popupRect.Height = maxHeight; Rectangle screenWorkingArea = Screen.GetWorkingArea(popupRect.Location); if (popupRect.Right > screenWorkingArea.Right) { popupRect.X -= popupRect.Right - screenWorkingArea.Right; } if (popupRect.Bottom > screenWorkingArea.Bottom) { popupRect.Y = ownerTreeList.PointToScreen(filterButtonRect.Location).Y - popupRect.Height; } return(popupRect); }