// Zero based device index and device params and output window public Capture(int iDeviceNum, int iWidth, int iHeight, short iBPP, Control hControl) { DsDevice[] capDevices; // Get the collection of video devices capDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); if (iDeviceNum + 1 > capDevices.Length) { throw new Exception("No video capture devices found at that index!"); } try { // Set up the capture graph SetupGraph(capDevices[iDeviceNum], iWidth, iHeight, iBPP, hControl); // tell the callback to ignore new images m_PictureReady = new ManualResetEvent(false); } catch { Dispose(); throw; } }
public DockPanel() { ShowAutoHideContentOnHover = true; m_focusManager = new FocusManagerImpl(this); m_extender = new DockPanelExtender(this); m_panes = new DockPaneCollection(); m_floatWindows = new FloatWindowCollection(); SuspendLayout(); m_autoHideWindow = Extender.AutoHideWindowFactory.CreateAutoHideWindow(this); m_autoHideWindow.Visible = false; m_autoHideWindow.ActiveContentChanged += m_autoHideWindow_ActiveContentChanged; SetAutoHideWindowParent(); m_dummyControl = new DummyControl(); m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1); Controls.Add(m_dummyControl); LoadDockWindows(); m_dummyContent = new DockContent(); ResumeLayout(); }
public void EventHandler(Control ctrl) { ctrl.MouseMove += new MouseEventHandler(OnMouseMove); ctrl.MouseDown += new MouseEventHandler(OnMouseDown); ctrl.MouseUp +=new MouseEventHandler(OnMouseUp); ctrl.MouseDoubleClick += new MouseEventHandler(OnMouseDoubleClick); }
/// <summary> /// Check if control is in parent control. /// </summary> /// <param name="parent"></param> /// <param name="spcontrol"></param> public static void ThrowIfNotInWorkspace(Control parent, Control spcontrol) { if (parent.Controls.Contains(spcontrol) == false) { throw new ArgumentException(Resources.SmartPartNotInManager); } }
public static CardView FindParentCardView(Control control) { Control parent = control.Parent; while(parent != control.FindForm() && !(parent is CardView)) parent = parent.Parent; return parent as CardView; }
public void HostControl(Control c) { DocumentForm frm = new DocumentForm(c); frm.ShowHint = DockState.Document; frm.Show(m_dockPanel); }
public IApplicationWindow create_tool_tip_for(string title, string caption, Control control) { var tip = new ToolTip {IsBalloon = true, ToolTipTitle = title}; tip.SetToolTip(control, caption); control.Controls.Add(new ControlAdapter(tip)); return this; }
public void limpa(Control controls) { foreach (Control child in controls.Controls.Cast<Control>().OrderBy(c => c.TabIndex)) { if (child is Label) { } else if (child is Button) { } else if (child is DataGridView) { } else if (child is TextBox) { if (!string.IsNullOrEmpty(child.Text) || (!string.IsNullOrWhiteSpace(child.Text) || child.Text != string.Empty)) child.Text = ""; } else if (child is MaskedTextBox) { ((MaskedTextBox)child).TextMaskFormat = MaskFormat.ExcludePromptAndLiterals; if ((!string.IsNullOrEmpty(child.Text) || !string.IsNullOrWhiteSpace(child.Text)) || child.Text != string.Empty) { child.Text = ""; } } else if (child is ComboBox && ((ComboBox)child).SelectedIndex > 0) { ((ComboBox)child).SelectedIndex = -1; } } }
/// <summary> /// Sets the status on the given control. /// </summary> /// <remarks> /// This method is a synonym for <see cref="SetError(Control p_ctlControl, string p_strMessage)"/>. /// </remarks> /// <param name="p_vtbPage">The control for which to display the message.</param> /// <param name="p_strMessage">The status message to display for the control.</param> /// <seealso cref="SetError(Control p_ctlControl, string p_strMessage)"/> public void SetStatus(Control p_ctlControl, string p_strMessage) { Control ctlSite = p_ctlControl; while (ctlSite is IStatusProviderAware) ctlSite = ((IStatusProviderAware)ctlSite).StatusProviderSite; base.SetError(ctlSite, p_strMessage); }
public static Point RtlTransform(Control control, Point point) { if (control.RightToLeft != RightToLeft.Yes) return point; else return new Point(control.Right - point.X, point.Y); }
public static Rectangle RtlTransform(Control control, Rectangle rectangle) { if (control.RightToLeft != RightToLeft.Yes) return rectangle; else return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height); }
/// <summary> /// Smartly hooks Click event of children of a control to call event handler of the caller. /// </summary> protected void HookClickEventOfChildren(Control control) { foreach (Control child in control.Controls) { child.Click += (s, e) => OnClick(e); } }
protected TextBox BuildDirPanel(Control parent, String name) { Panel panel = new Panel(); panel.Dock = DockStyle.Top; panel.Height = 60; Label l = new Label(); l.Location = new Point(0, 0); l.Dock = DockStyle.Left; l.Text = name; l.AutoSize = true; panel.Controls.Add(l); TextBox textBox = new TextBox(); textBox.Location = new Point(10, 20); textBox.Width = ((ICustPanel)this).PreferredSize.Width - 40; panel.Controls.Add(textBox); // Don't have a reasonable directory browser and don't feel // like doing the P/Invoke for the underlying one. Sigh. /***** Button b = new Button(); b.Location = new Point(120, 20); b.Width = 20; b.Text = "..."; b.Tag = textBox; b.Click += new EventHandler(DirButtonClicked); panel.Controls.Add(b); *****/ parent.Controls.Add(panel); return textBox; }
/// <summary> /// Initialize a new instance of the ViewContext class. /// </summary> /// <param name="manager">Reference to the view manager.</param> /// <param name="control">Control associated with rendering.</param> /// <param name="alignControl">Control used for aligning elements.</param> /// <param name="renderer">Rendering provider.</param> public ViewContext(ViewManager manager, Control control, Control alignControl, IRenderer renderer) : this(manager, control, alignControl, null, renderer) { }
private void UpdateBackgroundColor(Control parent) { if (parent == null) return; if (parent.BackColor == Color.Transparent) { if (parent is TabPage) { BackColor = SystemColors.Window; return; } UpdateBackgroundColor(parent.Parent); return; } try { BackColor = parent.BackColor; } catch { UpdateBackgroundColor(parent.Parent); } }
internal StylusAsyncPlugin(IStylusReaderHooks subject, Control attached) { Graphics g = subject.CreateGraphics(); attachedControl = attached; this.ratio = new PointF(g.DpiX / 2540.0f, g.DpiY / 2540.0f); this.subject = subject; }
protected void BrowseForFile(Control target, string filter, TextBoxEditMode textBoxEditMode) { if (target == null) { throw new ArgumentNullException("target"); } new BrowseButtonEvent(this, target, filter, textBoxEditMode).Event(null, null); }
public VisibleSurface(Control surface) : base(surface.Width, surface.Height) { base.DC = surface.CreateGraphics(); base.Buffer = new Backbuffer(this); this.RedrawDirtyRectangleOnly = true; }
/// <summary> /// Constructor /// </summary> /// <param name="context"/> /// <param name="location"/> public InflAffixTemplateEventArgs(Control context, XmlNode node, Point location, int tag) { m_location = location; m_node = node; m_contextControl = context; m_tag = tag; }
public static void Init(Control control, Control container, Direction direction) { bool Dragging = false; Point DragStart = Point.Empty; control.MouseDown += delegate(object sender, MouseEventArgs e) { Dragging = true; DragStart = new Point(e.X, e.Y); control.Capture = true; }; control.MouseUp += delegate(object sender, MouseEventArgs e) { Dragging = false; control.Capture = false; }; control.MouseMove += delegate(object sender, MouseEventArgs e) { if (Dragging) { if (direction != Direction.Vertical) container.Left = Math.Max(0, e.X + container.Left - DragStart.X); if (direction != Direction.Horizontal) container.Top = Math.Max(0, e.Y + container.Top - DragStart.Y); } }; }
protected void CreateInputDevices(Control target) { // create keyboard device. keyboard = new Device(SystemGuid.Keyboard); if (keyboard == null) { throw new Exception("No keyboard found."); } // create mouse device. mouse = new Device(SystemGuid.Mouse); if (mouse == null) { throw new Exception("No mouse found."); } // set cooperative level. keyboard.SetCooperativeLevel(target, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background); mouse.SetCooperativeLevel(target, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background); // Acquire devices for capturing. keyboard.Acquire(); mouse.Acquire(); }
public string Vaildate() { string errortxt = string.Empty; if (this.orderkey.Text.Length == 0) { focusControl = this.orderkey; errortxt += "订单号必填"; } if (this.checkuser.Text.Length == 0) { if (string.IsNullOrEmpty(errortxt)) focusControl = this.checkuser; errortxt += "拣货员必填"; } if (this.qty.Text.Length == 0) { if (string.IsNullOrEmpty(errortxt)) focusControl = this.qty; errortxt += "分拣数必填"; } return errortxt; }
/// <include file='doc\DataGridViewControlCollection.uex' path='docs/doc[@for="DataGridView.DataGridViewControlCollection.Remove"]/*' /> public override void Remove(Control value) { if (value != owner.horizScrollBar && value != owner.vertScrollBar && value != this.owner.editingPanel) { base.Remove(value); } }
public static PlayerView FindParentPlayerView(Control control) { Control parent = control.Parent; while(parent != control.FindForm() && !(parent is PlayerView)) parent = parent.Parent; return parent as PlayerView; }
private void modello770TelematicoUCLoad(object sender, EventArgs e) { _listaRitenute = getRitenuteVersateService().GetLista(_condominio); getRitenuteVersateService().SearchComplete += modello770TelematicoUCSearchComplete; getRitenuteVersateService().SetAnno(DateTime.Today.Year - 1); _listaRitenute.Dock = DockStyle.Fill; splitContainer1.Panel1.Controls.Add(_listaRitenute); _datiCertificazioneUC = new DatiCertificazioneUC {Dock = DockStyle.Fill}; splitContainer1.Panel2.Controls.Add(_datiCertificazioneUC); sceltaFornitoreCombo1.LoadData(); dataDichiarazione.Value = DateTime.Today; numeroIscrizioneCaf.Value = null; validationSummarySceltaRitenute.Validators.Add(parametersValidator); validationSummarySceltaRitenute.Validators.Add(ritenuteValidator); validationSummaryCreazioneFile.Validators.Add(reqFile); validationSummaryCreazioneFile.Validators.Add(reqDataDichiarazione); validationSummaryCreazioneFile.Validators.Add(codiceFiscaleValidator); validationSummaryCreazioneFile.Validators.Add(codiceFiscaleIntermediarioValidator); Clear(); }
private static Point GetLinkControlLocationBy(Control activityControl, ActivityControlsLink activityControlsLink, Control linkControl){ NeighbourDirections direction = activityControlsLink.Direction; int x = activityControl.Location.X; int y = activityControl.Location.Y; if (direction == NeighbourDirections.Top){ x += 5; y -= 5; } else if (direction == NeighbourDirections.Bottom) { x += 5; y += activityControl.Height - 5; } else if (direction == NeighbourDirections.Left){ x -= 5; // y += 5; } else {//Right x += activityControl.Width - 5; // y += 5; } if (direction == NeighbourDirections.Top || direction == NeighbourDirections.Bottom) { linkControl.Width = activityControl.Width - 10; linkControl.Height = 10; } else{ linkControl.Height = activityControl.Height;// -10; linkControl.Width = 10; } return new Point(x, y); }
/// <summary> /// Initializes a new instance of the <see cref="GameContext" /> class. /// </summary> /// <param name="control">The control.</param> /// <param name="requestedWidth">Width of the requested.</param> /// <param name="requestedHeight">Height of the requested.</param> public GameContext(Control control, int requestedWidth = 0, int requestedHeight = 0) { Control = control ?? new RenderForm("SharpDX Game"); RequestedWidth = requestedWidth; RequestedHeight = requestedHeight; ContextType = GameContextType.Desktop; }
static public bool IsContainer(Control control) { return control is TabControl || control is TabPage || control is Panel; }
/// <summary> /// Initialize a new instance of the ViewContext class. /// </summary> /// <param name="control">Control associated with rendering.</param> /// <param name="alignControl">Control used for aligning elements.</param> /// <param name="graphics">Graphics instance for drawing.</param> /// <param name="renderer">Rendering provider.</param> public ViewContext(Control control, Control alignControl, Graphics graphics, IRenderer renderer) : this(null, control, alignControl, graphics, renderer) { }
protected override System.Drawing.Point ScrollToControl(Control activeControl) { if (defaultBehaviour) return base.ScrollToControl(activeControl); return DisplayRectangle.Location; }
protected override void SetContent(swf.Control contentControl) { content.Controls.Clear(); content.Controls.Add(contentControl); }
private void grdRole_Click(object sender, EventArgs e) { this.LastControl = this.grdRole; }
public void AddControl(System.Windows.Forms.Control control) { control.Location = control.Location; control.Size = control.Size; this.Controls.Add(control); }
public DataTable CargaGridCategoria(System.Windows.Forms.Control root, System.Windows.Forms.Control root1, System.Windows.Forms.Control root2, System.Windows.Forms.Control root3, System.Windows.Forms.Control root4) { if (ObtenerAutorizacion() == "A") { return(CargaGridyCombo("select * from pyme.usuarios")); } else { bloqueo(root, root1, root2, root3, root4, false); return(CargaGridyCombo("select * from pyme.usuarios where IdUsuario=" + Constants.Id_usuario + ";")); } }
/// <summary> /// Gets the maximum value. /// </summary> /// <param name="control">The control.</param> /// <returns>System.Int32.</returns> public int GetMaximumValue(System.Windows.Forms.Control control) { return(255); }
protected FragmentControlProvider GetProvider(SWF.Control control) { return(Navigation.TryGetChild(control)); }
public static void SuspendDrawing(System.Windows.Forms.Control _ctrl) { SendMessage(_ctrl.Handle, WM_SETREDRAW, false, 0); }
private void DialogConfiguration_Load(object sender, EventArgs e) { this.Icon = ResourceManager.ImageToIcon(ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConfiguration]); _UIControl = Owner; }
private void CreateMarginBoundsList() { this.commonSizes.Clear(); if (this.Control.Controls.Count == 0) { this.childInfo = new ChildInfo[0]; } else { this.childInfo = new ChildInfo[this.Control.Controls.Count]; Point point = this.Control.PointToScreen(Point.Empty); System.Windows.Forms.FlowDirection direction = this.RTLTranslateFlowDirection(this.Control.FlowDirection); bool horizontalFlow = this.HorizontalFlow; int x = 0x7fffffff; int y = -1; int num3 = -1; if ((horizontalFlow && (direction == System.Windows.Forms.FlowDirection.RightToLeft)) || (!horizontalFlow && (direction == System.Windows.Forms.FlowDirection.BottomUp))) { num3 = 0x7fffffff; } int index = 0; bool flag2 = this.Control.RightToLeft == RightToLeft.Yes; index = 0; while (index < this.Control.Controls.Count) { System.Windows.Forms.Control control = this.Control.Controls[index]; Rectangle marginBounds = this.GetMarginBounds(control); Rectangle bounds = control.Bounds; if (horizontalFlow) { bounds.X -= !flag2 ? control.Margin.Left : control.Margin.Right; bounds.Width += control.Margin.Horizontal; bounds.Height--; } else { bounds.Y -= control.Margin.Top; bounds.Height += control.Margin.Vertical; bounds.Width--; } marginBounds.Offset(point.X, point.Y); bounds.Offset(point.X, point.Y); this.childInfo[index].marginBounds = marginBounds; this.childInfo[index].controlBounds = bounds; this.childInfo[index].inSelectionColl = false; if ((this.dragControls != null) && this.dragControls.Contains(control)) { this.childInfo[index].inSelectionColl = true; } if (horizontalFlow) { if ((((direction == System.Windows.Forms.FlowDirection.LeftToRight) ? (marginBounds.X < num3) : (marginBounds.X > num3)) && (x > 0)) && (y > 0)) { this.commonSizes.Add(new Rectangle(x, y, y - x, index)); x = 0x7fffffff; y = -1; } num3 = marginBounds.X; if (marginBounds.Top < x) { x = marginBounds.Top; } if (marginBounds.Bottom > y) { y = marginBounds.Bottom; } } else { if ((((direction == System.Windows.Forms.FlowDirection.TopDown) ? (marginBounds.Y < num3) : (marginBounds.Y > num3)) && (x > 0)) && (y > 0)) { this.commonSizes.Add(new Rectangle(x, y, y - x, index)); x = 0x7fffffff; y = -1; } num3 = marginBounds.Y; if (marginBounds.Left < x) { x = marginBounds.Left; } if (marginBounds.Right > y) { y = marginBounds.Right; } } index++; } if ((x > 0) && (y > 0)) { this.commonSizes.Add(new Rectangle(x, y, y - x, index)); } int num5 = 0; for (index = 0; index < this.commonSizes.Count; index++) { Rectangle rectangle7; Label_043B: rectangle7 = (Rectangle)this.commonSizes[index]; if (num5 < rectangle7.Height) { if (horizontalFlow) { Rectangle rectangle3 = (Rectangle)this.commonSizes[index]; this.childInfo[num5].marginBounds.Y = rectangle3.X; Rectangle rectangle4 = (Rectangle)this.commonSizes[index]; this.childInfo[num5].marginBounds.Height = rectangle4.Width; } else { Rectangle rectangle5 = (Rectangle)this.commonSizes[index]; this.childInfo[num5].marginBounds.X = rectangle5.X; Rectangle rectangle6 = (Rectangle)this.commonSizes[index]; this.childInfo[num5].marginBounds.Width = rectangle6.Width; } num5++; goto Label_043B; } } } }
public FATabStripItem(System.Windows.Forms.Control displayControl) : this(string.Empty, displayControl) { }
/// <summary> /// Ga naar deze pagina /// </summary> /// <param name="control"></param> public void PageGoToPage(System.Windows.Forms.Control control) { // load the page into the contentcontrol //((PageContainer)((DockPanel)((ContentControl)Parent).Parent).Parent).LoadControl(control); Tools.FindVisualParent <PageContainer>(HHH).LoadControl(control); }
public void SetViewport(swf.Control control) { }
private void MoveControl_CheckAnswer(System.Windows.Forms.Control suruklenen, System.Windows.Forms.Control hedef) { if (WordProvider.CheckWord(suruklenen.Tag as Model.tbltrWord, hedef.Tag as Question)) { WordProvider.SetKnownWord((hedef.Tag as Question).EnWord, true); MessageBox.Show("Bildiniz"); } else { WordProvider.SetKnownWord((hedef.Tag as Question).EnWord, false); MessageBox.Show("Uzgunum Bılemedınız"); } ShowNewQuestion(); }
/// <summary> /// 判断控件是否在设计模式下 /// </summary> public static bool IsInDesignMode(this System.Windows.Forms.Control control) { return(ResolveDesignMode(control)); }
public void SetViewport(swf.Control control) { var r = control.ClientRectangle; SetViewport(r.Left, r.Top, r.Width, r.Height); }
protected override void OnDragDrop(DragEventArgs de) { bool flag = false; if (((this.dragControls != null) && (this.primaryDragControl != null)) && this.Control.Controls.Contains(this.primaryDragControl)) { flag = true; } if (!flag) { if (this.Control != null) { this.Control.ControlAdded += new ControlEventHandler(this.OnChildControlAdded); } try { base.OnDragDrop(de); } finally { if (this.Control != null) { this.Control.ControlAdded -= new ControlEventHandler(this.OnChildControlAdded); } } } else { IDesignerHost host = this.GetService(typeof(IDesignerHost)) as IDesignerHost; if (host != null) { string str; DesignerTransaction transaction = null; bool flag2 = de.Effect == DragDropEffects.Copy; ArrayList list = null; ISelectionService service = null; if (this.dragControls.Count == 1) { string componentName = TypeDescriptor.GetComponentName(this.dragControls[0]); if ((componentName == null) || (componentName.Length == 0)) { componentName = this.dragControls[0].GetType().Name; } str = System.Design.SR.GetString(flag2 ? "BehaviorServiceCopyControl" : "BehaviorServiceMoveControl", new object[] { componentName }); } else { str = System.Design.SR.GetString(flag2 ? "BehaviorServiceCopyControls" : "BehaviorServiceMoveControls", new object[] { this.dragControls.Count }); } transaction = host.CreateTransaction(str); try { while ((this.insertIndex < (this.childInfo.Length - 1)) && this.childInfo[this.insertIndex].inSelectionColl) { this.insertIndex++; } IComponentChangeService service2 = this.GetService(typeof(IComponentChangeService)) as IComponentChangeService; PropertyDescriptor member = TypeDescriptor.GetProperties(this.Control)["Controls"]; System.Windows.Forms.Control child = null; if (this.insertIndex != this.childInfo.Length) { child = this.Control.Controls[this.insertIndex]; } else { this.insertIndex = -1; } if ((service2 != null) && (member != null)) { service2.OnComponentChanging(this.Control, member); } if (!flag2) { for (int j = 0; j < this.dragControls.Count; j++) { this.Control.Controls.Remove(this.dragControls[j] as System.Windows.Forms.Control); } if (child != null) { this.insertIndex = this.Control.Controls.GetChildIndex(child, false); } } else { ArrayList objects = new ArrayList(); for (int k = 0; k < this.dragControls.Count; k++) { objects.Add(this.dragControls[k]); } objects = DesignerUtils.CopyDragObjects(objects, base.Component.Site) as ArrayList; if (objects == null) { return; } list = new ArrayList(); for (int m = 0; m < objects.Count; m++) { list.Add(this.dragControls[m]); if (this.primaryDragControl.Equals(this.dragControls[m] as System.Windows.Forms.Control)) { this.primaryDragControl = objects[m] as System.Windows.Forms.Control; } this.dragControls[m] = objects[m]; } service = (ISelectionService)this.GetService(typeof(ISelectionService)); } if (this.insertIndex == -1) { this.insertIndex = this.Control.Controls.Count; } this.Control.Controls.Add(this.primaryDragControl); this.Control.Controls.SetChildIndex(this.primaryDragControl, this.insertIndex); this.insertIndex++; if (service != null) { service.SetSelectedComponents(new object[] { this.primaryDragControl }, SelectionTypes.Click | SelectionTypes.Replace); } for (int i = this.dragControls.Count - 1; i >= 0; i--) { if (!this.primaryDragControl.Equals(this.dragControls[i] as System.Windows.Forms.Control)) { this.Control.Controls.Add(this.dragControls[i] as System.Windows.Forms.Control); this.Control.Controls.SetChildIndex(this.dragControls[i] as System.Windows.Forms.Control, this.insertIndex); this.insertIndex++; if (service != null) { service.SetSelectedComponents(new object[] { this.dragControls[i] }, SelectionTypes.Add); } } } if ((service2 != null) && (member != null)) { service2.OnComponentChanged(this.Control, member, null, null); } if (list != null) { for (int n = 0; n < list.Count; n++) { this.dragControls[n] = list[n]; } } base.OnDragComplete(de); if (transaction != null) { transaction.Commit(); transaction = null; } } finally { if (transaction != null) { transaction.Cancel(); } } } } this.insertIndex = InvalidIndex; }
private void Piece_Click(object sender, System.EventArgs e) { System.Windows.Forms.Control PictureCont = (System.Windows.Forms.Control)sender; SelectedIndex = System.Convert.ToInt16(PictureCont.Name.Substring("Piece".Length)); // strip the piece word and get the index this.Close(); // unload the form }
private Rectangle GetMarginBounds(System.Windows.Forms.Control control) { return(new Rectangle(control.Bounds.Left - ((this.Control.RightToLeft == RightToLeft.No) ? control.Margin.Left : control.Margin.Right), control.Bounds.Top - control.Margin.Top, control.Bounds.Width + control.Margin.Horizontal, control.Bounds.Height + control.Margin.Vertical)); }
public static void ResumeDrawing(System.Windows.Forms.Control _ctrl) { SendMessage(_ctrl.Handle, WM_SETREDRAW, true, 0); _ctrl.Refresh(); }
public ImControl(WForms.Control control) { WfControl = control; }
protected override sd.Point ScrollToControl(swf.Control activeControl) { return(AutoScrollPosition); }
public void m_mthFussQueryPat(com.digitalwave.iCare.gui.LIS.frmLisAppl p_frmLisAppl, System.Windows.Forms.Control p_objControl) { p_frmLisAppl.m_lsvPatFussQuery.Items.Clear(); p_frmLisAppl.m_lsvPatFussQuery.Left = p_frmLisAppl.m_grpPatientInfo.Left + p_objControl.Left; p_frmLisAppl.m_lsvPatFussQuery.Top = p_frmLisAppl.m_grpPatientInfo.Top + p_objControl.Top + p_objControl.Height; string strControlName = p_objControl.Name; string p_strFussField = null; string p_strFussValue = null; string p_strOrderField = "patientid_chr"; int intQueryType = 0; switch (strControlName) { case "m_txtPatCardID": p_strFussField = "PATIENTCARDID_CHR"; p_strFussValue = p_frmLisAppl.m_txtPatCardID.Text; intQueryType = 1; break; case "m_txtPatName": p_strFussField = "name_vchr"; p_strFussValue = p_frmLisAppl.m_txtPatName.Text; break; case "m_txtInhospNO": p_strFussField = "inpatientid_chr"; p_strFussValue = p_frmLisAppl.m_txtInhospNO.Text; break; } com.digitalwave.iCare.middletier.PatientSvc.clsPatientSvc objPatSvc = null; objPatSvc = (com.digitalwave.iCare.middletier.PatientSvc.clsPatientSvc)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(com.digitalwave.iCare.middletier.PatientSvc.clsPatientSvc)); System.Security.Principal.IPrincipal p_objPrincipal = null; long lngRes = 0; com.digitalwave.iCare.ValueObject.clsPatientVO[] objPatList = null; lngRes = objPatSvc.m_lngGetPatientListByFuzzyCriteria(p_objPrincipal, intQueryType, p_strFussField, p_strFussValue, p_strOrderField, false, out objPatList); if (lngRes == 1 && objPatList != null) { if (objPatList.Length > 1) { for (int i = 0; i < objPatList.Length; i++) { System.Windows.Forms.ListViewItem objListViewItem = new System.Windows.Forms.ListViewItem(); objListViewItem.Text = objPatList[i].strPatientID; objListViewItem.SubItems.Add(objPatList[i].strPatientCardID); objListViewItem.SubItems.Add(objPatList[i].strInPatientID); objListViewItem.SubItems.Add(objPatList[i].strName); objListViewItem.Tag = objPatList[i]; p_frmLisAppl.m_lsvPatFussQuery.Items.Add(objListViewItem); } p_frmLisAppl.m_lsvPatFussQuery.Select(); p_frmLisAppl.m_lsvPatFussQuery.Visible = true; p_frmLisAppl.m_lsvPatFussQuery.Focus(); p_frmLisAppl.m_lsvPatFussQuery.Items[0].Selected = true; p_frmLisAppl.m_lsvPatFussQuery.Items[0].Focused = true; } else if (objPatList.Length == 1) { p_frmLisAppl.m_txtPatCardID.Text = objPatList[0].strPatientCardID; p_frmLisAppl.m_txtPatName.Text = objPatList[0].strName; p_frmLisAppl.m_cboSex.Text = objPatList[0].strSex; p_frmLisAppl.m_txtInhospNO.Text = objPatList[0].strInPatientID; p_frmLisAppl.m_txtPatientID.Text = objPatList[0].strPatientID; if (objPatList[0].strBirthDate != null && Microsoft.VisualBasic.Information.IsDate(objPatList[0].strBirthDate)) { string strAge = clsAgeConverter.s_strToAge(DateTime.Parse(objPatList[0].strBirthDate), " 岁| 月| 天"); p_frmLisAppl.m_txtAge.Text = clsAgeConverter.m_strGetAgeNum(strAge); p_frmLisAppl.m_cboAgeUnit.Text = clsAgeConverter.m_strGetAgeUnit(strAge); } } } }
public void bloqueo(System.Windows.Forms.Control root, System.Windows.Forms.Control root1, System.Windows.Forms.Control root2, System.Windows.Forms.Control root3, System.Windows.Forms.Control root4, bool activar) { root.Visible = activar; root1.Visible = activar; root2.Enabled = activar; root3.Visible = activar; root4.Visible = activar; }
/// <summary> /// 触发显示子控件事件 /// </summary> /// <param name="control">子控件</param> public static void OnViewTableControlEvent(UserControl control, System.Windows.Forms.Control parent) { ViewTableControlEvent(control, parent); }
/// <summary> /// Gets the minimum value. /// </summary> /// <param name="control">The control.</param> /// <returns>System.Int32.</returns> public int GetMinimumValue(System.Windows.Forms.Control control) { return(0); }
// Override this method in order to access the containing user controls // from the default Collection Editor form or to add new ones... protected override CollectionForm CreateCollectionForm() { // Getting the default layout of the Collection Editor... CollectionForm collectionForm = base.CreateCollectionForm(); bool allowAdd = false; bool allowRemove = false; Form frmCollectionEditorForm = collectionForm as Form; frmCollectionEditorForm.HelpButton = false; frmCollectionEditorForm.Text = "Collection Editor"; if (CollectionItemType == typeof(ReportRestriction)) { frmCollectionEditorForm.Text = "Restrictions Collection Editor"; } else if (CollectionItemType == typeof(Parameter)) { frmCollectionEditorForm.Text = "Template Parameters Collection Editor"; } else if (CollectionItemType == typeof(SecurityParameter)) { frmCollectionEditorForm.Text = "Security Parameters Collection Editor"; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SecurityGroup)) { frmCollectionEditorForm.Text = "Security Groups Collection Editor"; allowAdd = true; allowRemove = true; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SecurityFolder)) { frmCollectionEditorForm.Text = "Security Folders Collection Editor"; allowAdd = true; allowRemove = true; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SecurityColumn)) { frmCollectionEditorForm.Text = "Security Columns Collection Editor"; allowAdd = true; allowRemove = true; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SecuritySource)) { frmCollectionEditorForm.Text = "Security Data Sources Collection Editor"; allowAdd = true; allowRemove = true; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SecurityDevice)) { frmCollectionEditorForm.Text = "Security Devices Collection Editor"; allowAdd = true; allowRemove = true; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SecurityConnection)) { frmCollectionEditorForm.Text = "Security Connections Collection Editor"; allowAdd = true; allowRemove = true; _useHandlerInterface = false; } else if (CollectionItemType == typeof(SubReport)) { frmCollectionEditorForm.Text = "Sub-Reports Collection Editor"; allowRemove = true; _useHandlerInterface = true; } TableLayoutPanel tlpLayout = frmCollectionEditorForm.Controls[0] as TableLayoutPanel; if (tlpLayout != null) { // Get a reference to the inner PropertyGrid and hook // an event handler to it. if (tlpLayout.Controls[5] is PropertyGrid) { PropertyGrid propertyGrid = tlpLayout.Controls[5] as PropertyGrid; propertyGrid.HelpVisible = true; propertyGrid.ToolbarVisible = false; propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyGrid_PropertyValueChanged); } } //Hide Add/Remove -> Get the forms type if (!allowRemove) { Type formType = frmCollectionEditorForm.GetType(); FieldInfo fieldInfo = formType.GetField("removeButton", BindingFlags.NonPublic | BindingFlags.Instance); if (fieldInfo != null) { System.Windows.Forms.Control removeButton = (System.Windows.Forms.Control)fieldInfo.GetValue(frmCollectionEditorForm); removeButton.Hide(); } } if (!allowAdd) { Type formType = frmCollectionEditorForm.GetType(); FieldInfo fieldInfo = formType.GetField("addButton", BindingFlags.NonPublic | BindingFlags.Instance); if (fieldInfo != null) { System.Windows.Forms.Control addButton = (System.Windows.Forms.Control)fieldInfo.GetValue(frmCollectionEditorForm); addButton.Hide(); } } return(collectionForm); }
private void AddToPanel(System.Windows.Forms.Control NewControl) { this.SecundaryPanel.Controls.Clear(); this.SecundaryPanel.Controls.Add(NewControl); ChangeStatus(); }
public bool VerifyPrintToSingleFile(System.Windows.Forms.Control controlToEnableOrNot) { // Enable terms (or): // 1. Print to virtual priter (PDF or DWF printer) return(controlToEnableOrNot.Enabled = m_printMgr.IsVirtual != VirtualPrinterType.None); }
public static double GetDeviceDpi(this System.Windows.Forms.Control form) { return(form.DeviceDpi / 96.0); }
public static System.Collections.Generic.List <System.Windows.Forms.Control> GetAllChildControls(System.Windows.Forms.Control c) { System.Collections.Generic.List <System.Windows.Forms.Control> list = new System.Collections.Generic.List <System.Windows.Forms.Control>(); Oranikle.Studio.Controls.BaseUserControl.GetAllChildControlsHelper(c, list); return(list); }