Inheritance: ContainerControl
        private void ListView_SelectedIndexChanged( object sender, EventArgs e )
        {
            Point cursorPoint = this.ListView.PointToClient( Cursor.Position );
            ListViewItem listViewItem = this.ListView.GetItemAt( cursorPoint.X, cursorPoint.Y );
            if ( listViewItem == null )
                return;

            UserControl outDocumentFormSub1 = null;
            if ( m_AllDocumenInfo.TryGetValue( listViewItem, out outDocumentFormSub1 ) == false )
            {
                if ( this.m_CurrentDocumen != null )
                    this.m_CurrentDocumen.Visible = false;
            }
            else
            {
                if ( this.m_CurrentDocumen != null && outDocumentFormSub1 != this.m_CurrentDocumen )
                    this.m_CurrentDocumen.Visible = false;

                if ( outDocumentFormSub1 != null )
                {
                    outDocumentFormSub1.Visible = true;
                    this.m_CurrentDocumen = outDocumentFormSub1;
                }
            }
        }
Ejemplo n.º 2
0
        public static void changeScreen(UserControl current, string next)
        {

            //tmp is set to the form that this control is on
            Form tmp = current.FindForm();
            tmp.Controls.Remove(current);
            UserControl ns = null;

            switch (next)
            {
                case "GameScreen":
                    ns = new GameScreen();
                    break;
                case "InstructionScreen":
                    ns = new InstructionScreen();
                    break;
                case "MenuScreen":
                    ns = new MenuScreen();
                    break;
                case "OptionScreen":
                    ns = new OptionScreen();
                    break;
                case "ScoreScreen":
                    ns = new ScoreScreen();
                    break;

            }

            ns.Size = new Size(controlWidth, controlHeight);
            ns.Location = startCentre;
            tmp.Controls.Add(ns);
            ns.Focus();
        }
Ejemplo n.º 3
0
 public void add(UserControl userControl)
 {
     userControl.Top = userControls.Count*(userControl.Height + 1);
     userControls.Add(userControl);
     userControl.Left = 0;
     userControl.Parent = this;
 }
Ejemplo n.º 4
0
 /// <summary></summary>
 /// <param name="p_usrctrl"></param>
 /// <param name="p_comp"></param>
 public void TranslateText(System.Windows.Forms.UserControl p_usrctrl, System.ComponentModel.IContainer p_comp)
 {
     if (this.g_cultureinfo.Name != "ko-KR")
     {
         this.g_trnsHelper.TranslateText(p_usrctrl, p_comp, g_cultureinfo.Name);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        ///     Recurs <c>UserControl</c> to change.
        /// </summary>
        /// <param name="parent">
        ///     <c>UserControl</c> object to scan.
        /// </param>
        private void RecurUserControl(System.Windows.Forms.UserControl userControl)
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(userControl.GetType());
            ToolTip toolTip = GetToolTip(userControl);

            RecurControls(userControl, resources, toolTip);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Configures the editor</summary>
        /// <param name="treeControl">Control to display data</param>
        /// <param name="treeControlAdapter">Adapter to drive control. Its ITreeView should
        /// implement IInstancingContext and/or IHierarchicalInsertionContext.</param>
        /// <remarks>Default is to create a TreeControl and TreeControlAdapter,
        /// using the global image lists.</remarks>
        protected override void Configure(
            out TreeControl treeControl,
            out TreeControlAdapter treeControlAdapter)
        {
            treeControl = new TreeControl();
            treeControl.ImageList = ResourceUtil.GetImageList16();
            treeControl.StateImageList = ResourceUtil.GetImageList16();

            treeControlAdapter = new TreeControlAdapter(treeControl);

            treeControl.PreviewKeyDown += treeControl_PreviewKeyDown;
            treeControl.NodeExpandedChanging += treeControl_NodeExpandedChanging;
            treeControl.NodeExpandedChanged += treeControl_NodeExpandedChanged;

 
            m_searchInput = new StringSearchInputUI();
            m_searchInput.Updated += UpdateFiltering;

            m_control = new UserControl();
            m_control.Dock = DockStyle.Fill;
            m_control.SuspendLayout();
            m_control.Name = "Tree View".Localize();
            m_control.Text = "Tree View".Localize();
            m_control.Controls.Add(m_searchInput);
            m_control.Controls.Add(TreeControl);
            m_control.Layout += controls_Layout;
            m_control.ResumeLayout();
        }
        public void SetTaskPaneViewModel(ViewModelBase vm)
        {
            if (TaskPane == null)
            {
                TaskPaneControl = new TreemapView((TreemapViewModel)vm);
                ElementHost host = new ElementHost { Child = TaskPaneControl };
                host.Dock = DockStyle.Fill;
                UserControl userControl = new UserControl();
                userControl.BackColor = Color.White;
                userControl.Controls.Add(host);
                TaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(userControl, "Treemap");
                TaskPane.VisibleChanged += (sender, e) =>
                {
                    if (!TaskPane.Visible)
                    {
                        TreemapViewModel tvm = (TreemapViewModel)TaskPaneControl.DataContext;
                        tvm.IsDead = true;
                    }
                };
            }
            else
            {
                TaskPaneControl.DataContext = vm;
            }

            TaskPane.Width = 400;
            TaskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionRight;
            TaskPane.Visible = true;
        }
Ejemplo n.º 8
0
        private void PluginView_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            if (e.Node.Tag == null)
            {
                return;
            }

            PluginInfo pluginInfo = e.Node.Tag as PluginInfo;

            if (pluginInfo.Plugin is IUserControlPlugin)
            {
                System.Windows.Forms.UserControl control = ((IUserControlPlugin)pluginInfo.Plugin).Content;
                panel1.Controls.Add(control); panel1.Visible = true;
                control.Dock = DockStyle.Fill;
            }
            else if (pluginInfo.Plugin is IFormPlugin)
            {
                IFormPlugin formPlugin = (IFormPlugin)pluginInfo.Plugin;
                Form        form       = formPlugin.Content;

                if (form.IsDisposed)
                {
                    form = PluginHelper.CreateNewInstance <Form>(pluginInfo.AssemblyPath);
                }

                if (formPlugin.ShowAs == ShowAs.Dialog)
                {
                    form.ShowDialog();
                }
                else
                {
                    form.Show();
                }
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            System.Windows.Forms.UserControl control = new System.Windows.Forms.UserControl();
            control.Width     = 100;
            control.Height    = 100;
            control.BackColor = System.Drawing.Color.Black;
            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
            host.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            host.VerticalAlignment   = VerticalAlignment.Stretch;
            host.Child = control;
            _remoteVideo.Children.Add(host);
            RemoteHwnd        = control.Handle;
            remoteCtl         = control;
            control           = new System.Windows.Forms.UserControl();
            control.Width     = 100;
            control.Height    = 100;
            control.BackColor = System.Drawing.Color.Black;
            host = new System.Windows.Forms.Integration.WindowsFormsHost();
            host.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            host.VerticalAlignment   = VerticalAlignment.Stretch;
            host.Child = control;
            _localVideo.Children.Add(host);
            LocalHwnd = control.Handle;
            localCtl  = control;
            this._roomNameInput.Text = "test";
            this._userIdInput.Text   = Guid.NewGuid().ToString().Split('-')[0];
            this.WC.FrameCaptured   += this.OnWaveFrameCaptured;
            this.WC.Init(2);
            this.SC.FrameCaptured += this.OnScreenFrameCaptured;
            var screen = System.Windows.Forms.Screen.PrimaryScreen;

            this.SC.Init(screen.GetHandle(), 0, 0, screen.Bounds.Width, screen.Bounds.Height, 0);
        }
Ejemplo n.º 10
0
 public NavigationTreePluginModule(
     IWindowHost windowHost,
     [Import("navigationMenu", typeof(UserControl))] NavigationTree navTree)
 {
     this.windowHost = windowHost;
     this.navTree = navTree;
 }
Ejemplo n.º 11
0
        private void DisplayView(Type type, ToolStripButton sender)
        {
            bool viewChanged = false;
            foreach (ToolStripItem item in tspMain.Items)
            {
                ToolStripButton button = item as ToolStripButton;
                if (button != null)
                {
                    if (button == sender)
                    {
                        viewChanged = (!button.Checked);
                    }
                    button.Checked = (button == sender);
                }
            }
            if (viewChanged)
            {
                // dispose of old control
                if (_control != null)
                {
                    pnlMain.Controls.Remove(_control);
                }

                // create new control
                _control = Activator.CreateInstance(type) as UserControl;
                pnlMain.Controls.Add(_control);
                _control.Dock = DockStyle.Fill;
            }
        }
Ejemplo n.º 12
0
 public static void refreshPanel(UserControl control)
 {
     CurrentPage = control;
     CurrentPage.AutoSize = true;
     CurrentPage.Dock = DockStyle.Fill;
     //mainPanel.Refresh();
 }
 public void SetExecutionWindow(UserControl control)
 {
     ExecutionPanel.Controls.Clear ();
     ExecutionPanel.Controls.Add (control);
     control.Dock = DockStyle.Fill;
     control.Select ();
 }
Ejemplo n.º 14
0
        public PaletteService(
            ICommandService commandService,
            IControlHostService controlHostService)
            : base(commandService)
        {
            m_controlHostService = controlHostService;

            m_searchInput = new StringSearchInputUI();
            m_searchInput.Updated += searchInput_Updated;

            m_control = new UserControl();
            m_control.Dock = DockStyle.Fill;
            m_control.SuspendLayout();
            m_control.Name = "Palette".Localize();
            m_control.Text = "Palette".Localize();
            m_control.Controls.Add(m_searchInput);
            m_control.Controls.Add(TreeControl);
            m_control.Layout += controls_Layout;
            m_control.ResumeLayout();

            m_controlHostService.RegisterControl(
                m_control,
                new ControlInfo(
                    "Palette", //Is the ID in the layout. We'll localize DisplayName instead.
                    "Creates new instances".Localize(),
                    StandardControlGroup.Left, null,
                    "https://github.com/SonyWWS/ATF/search?utf8=%E2%9C%93&q=PaletteService+or+Palette".Localize())
                {
                    DisplayName = "Palette".Localize()
                },
                this);
        }
Ejemplo n.º 15
0
        public PaletteService(
            ICommandService commandService,
            IControlHostService controlHostService)
            : base(commandService)
        {
            m_controlHostService = controlHostService;

            m_searchInput = new StringSearchInputUI();
            m_searchInput.Updated += searchInput_Updated;

            m_control = new UserControl();
            m_control.Dock = DockStyle.Fill;
            m_control.SuspendLayout();
            m_control.Name = "Palette".Localize();
            m_control.Text = "Palette".Localize();
            m_control.Controls.Add(m_searchInput);
            m_control.Controls.Add(TreeControl);
            m_control.Layout += controls_Layout;
            m_control.ResumeLayout();

            m_controlHostService.RegisterControl(
                m_control,
                new ControlInfo(
                    "Palette".Localize(),
                    "Creates new instances".Localize(),
                    StandardControlGroup.Left, null,
                    "http://www.ship.scea.com/portal/search/search.action?q=PaletteService+or+Palette&context=resource_WIKI%7CWWSSDKATF".Localize()),
                this);

            m_paletteTreeAdapter = new PaletteTreeAdapter(this, m_searchInput);
        }
Ejemplo n.º 16
0
 public void FillChart(UserControl uc)
 {
     //if (sender is UserControl)
     //{
     //OnDoubleClick(uc, new EventArgs());
     //}
 }
Ejemplo n.º 17
0
        //״̬�������������б��ʼ��
        public void InitData(string title, UCListType _uclType, UserControl _ucRetControl)
        {
            ucButtons.SetAckText("ˢ��");
            ucButtons.SetAckVisible(true);
            bValidSensor = false;
            CategoryIndex = -1;
            strTitle = title;
            uclType = _uclType;
            ucRetControl = _ucRetControl;
            InitPage();
            RefreshData();

            byte refresh = 0;
            switch (uclType)
            {
                case UCListType.UCLT_Status:
                    refresh = formFrame.configManage.cfg.paramFormWeight.RefreshStatus;
                    break;
                case UCListType.UCLT_Alarm:
                    refresh = formFrame.configManage.cfg.paramFormWeight.RefreshAlarm;
                    break;
                case UCListType.UCLT_Fault:
                    refresh = formFrame.configManage.cfg.paramFormWeight.RefreshFault;
                    break;
                default:
                    return;
            }
            RefreshControl(refresh);
        }
        public VSCodeEditorWindow(ServiceBroker sb, UserControl parent)
        {
            services = sb;
            coreEditor = new VSCodeEditor(parent.Handle, services);

            //Create window            
            IVsCodeWindow win = coreEditor.CodeWindow;
            cmdTarget = win as IOleCommandTarget;

            IVsTextView textView;
            int hr = win.GetPrimaryView(out textView);
            if (hr != VSConstants.S_OK)
                Marshal.ThrowExceptionForHR(hr);

            // assign the window handle
            IntPtr commandHwnd = textView.GetWindowHandle();
            AssignHandle(commandHwnd);

            //Register priority command target
            hr = services.VsRegisterPriorityCommandTarget.RegisterPriorityCommandTarget(
                0, (IOleCommandTarget)this, out cmdTargetCookie);

            if (hr != VSConstants.S_OK)
                Marshal.ThrowExceptionForHR(hr);

            //Add message filter
            Application.AddMessageFilter((System.Windows.Forms.IMessageFilter)this);
        }
Ejemplo n.º 19
0
 //-------------------------------------------
 // выбор в дереве разделов настроек
 private void radTreeView1_SelectedNodeChanged(object sender, RadTreeViewEventArgs e)
 {
     switch (radTreeView1.SelectedNode.Text)
     {
         case "Настройки":
             break;
         case "Основные":
             break;
         case "Каталоги":
             Main = new PrefMainFolders();
             radPanel1.Controls.Clear();
             radPanel1.Controls.Add(Main);
             break;
         case "Вид":
             Main = new PrefMainView();
             radPanel1.Controls.Clear();
             radPanel1.Controls.Add(Main);
             break;
         case "БД":
             Main = new PrefDB();
             radPanel1.Controls.Clear();
             radPanel1.Controls.Add(Main);
             break;
     }
 }
Ejemplo n.º 20
0
 internal void DisplayUserControl(UserControl userControl)
 {
     foreach (Control control in metroPanel.Controls)
     {
         if (control is UserControl)
         {
             if (control == userControl)
             {
                 if(control.Equals(view))
                     view.LoadView();
                 if (control.Equals(search))
                     search.LoadView();
                 control.Visible = true;
                 control.Enabled = true;
                 control.BringToFront();
                 control.Dock = DockStyle.Fill;
             }
             else
             {
                 control.Visible = false;
                 control.Enabled = false;
                 control.Dock = DockStyle.None;
                 Controls.Remove(control);
             }
         }
     }
 }
Ejemplo n.º 21
0
 public WizardPage(string text, UserControl userControl)
 {
   if (text == null || userControl == null)
     throw new ArgumentNullException();
   _userControl = userControl;
   _labelText = text;
 }
Ejemplo n.º 22
0
 public void OnMouseMove(UserControl canvas, MouseEventArgs e)
 {
     if (triangle == null || e.Button != MouseButtons.Left)
         return;
     triangle.EndPoint = e.Location;
     canvas.Refresh();
 }
Ejemplo n.º 23
0
 private void registrationToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     hideActiveControl();
     ActiveControl = registration;
     ActiveControl.Dock = DockStyle.Fill;
     registration.Show();
 }
Ejemplo n.º 24
0
 public void LoadControl(UserControl controlToLoad)
 {
     this.pContent.Controls.Clear();
     controlToLoad.Top = (this.pContent.Height - controlToLoad.Height) / 2;
     controlToLoad.Left = (this.pContent.Width - controlToLoad.Width) / 2;
     this.pContent.Controls.Add(controlToLoad);
 }
Ejemplo n.º 25
0
 protected override void InitializeUserControlView(UserControl ucView)
 {
     base.InitializeUserControlView(ucView);
     if (ucView.Parent != null) return;
     ucView.Parent = contentPanel;
     ucView.Dock = DockStyle.Fill;
 }
Ejemplo n.º 26
0
 private void dailyIntrestToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     hideActiveControl();
     ActiveControl = dailyintest;
     ActiveControl.Dock = DockStyle.Fill;
     dailyintest.Show();
 }
Ejemplo n.º 27
0
 public Form1(UserControl UC)
 {
     InitializeComponent();
     InitializeComponent();
     oUC = UC;
     this.Size = oUC.Size;
 }
Ejemplo n.º 28
0
 public WizardSetting(UserControl page, string title, string description, bool canFinish)
 {
     this.Page = page;
     this.CanFinish = canFinish;
     this.Title = title;
     this.Description = description;
 }
Ejemplo n.º 29
0
        private bool LoadDrawer()
        {
            string execDir = Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf('\\'));
            string modulePath = execDir + @"\modules\DrawGraph.dll";
            if (File.Exists(modulePath))
            {
                Assembly module;
                try
                {
                    module = module = Assembly.LoadFile(modulePath);
                }
                catch (FileLoadException)
                {
                    return false;
                }
                Type[] types = module.GetExportedTypes();
                if (types.Length != 1)
                    return false;
                if (/*!typeof(IGraphsLabModule).IsAssignableFrom(types[0])*/
                    (!typeof(IGraphLabsModule).IsAssignableFrom(types[0])) ||
                    (!typeof(UserControl).IsAssignableFrom(types[0])))
                    return false;

                drawer = (UserControl)Activator.CreateInstance(types[0]);
                SuspendLayout();
                (drawer as IGraphLabsModule).InitModule(graph);
                drawer.Dock = DockStyle.Fill;
                Controls.Add(drawer);
                ResumeLayout(false);
                return true;
            }
            else return false;
        }
Ejemplo n.º 30
0
 /// <summary>
 /// 添加标签 添加内容窗体
 /// </summary>
 /// <param name="userContol">新窗体</param>
 /// <param name="memuName">标签名 例: 车型档案-预览  或 车型档案</param>
 /// <param name="menuId">三级菜单id(新窗体+操作动词   例:新增 "UCBaseAdd"  如果是编辑或复制或预览 新窗体+操作动词+操作数据ID 例:UCBaseEdit123)</param>
 /// <param name="thisUcTag">当前窗体Tag tag包括(三级 |一级| 二级 菜单的id)</param>
 /// <param name="PUCName">当前窗体Name   this.Name)</param>
 public void addUserControl(UserControl userContol, string memuName, string menuId, string thisUcTag, string PUCName)
 {
     if (addUserControls != null)
     {
         addUserControls(userContol, memuName, menuId, thisUcTag, PUCName);
     }
 }
Ejemplo n.º 31
0
 public static void TranslateUC(UserControl uc)
 {
     foreach (Control c in uc.Controls)
     {
         c.Text = GetTranslation(c.Text, MainForm.ActualMainForm.Lang);
     }
 }
Ejemplo n.º 32
0
 public Form1(UserControl uc)
 {
     InitializeComponent();
     //this.Size = uc.Size;
     oUC = uc;
     
 }
Ejemplo n.º 33
0
 public void LoadUC(UserControl ucContent)
 {
     pnMain.Controls.Clear();
     ucContent.Dock = DockStyle.Fill;
     pnMain.Controls.Add(ucContent);
     ucContent.Focus();
 }
Ejemplo n.º 34
0
 protected void f_removeClient(UserControl cv)
 {
     panel.SuspendLayout();
     panel.Controls.Remove(cv);
     panel.ResumeLayout();
     panel.Update();
 }
Ejemplo n.º 35
0
 public void CarregarPanel(System.Windows.Forms.UserControl frm)
 {
     if (pnPrincipal.Controls.Count == 1)
     {
         pnPrincipal.Controls.RemoveAt(0);
     }
     pnPrincipal.Controls.Add(frm);
 }
Ejemplo n.º 36
0
 private void ActivateOptionControl(System.Windows.Forms.UserControl optionControl)
 {
     foreach (UserControl uc in this.UserControlContainer.Controls)
     {
         uc.Hide();
     }
     optionControl.Show();
 }
Ejemplo n.º 37
0
 public void LoadPage(System.Windows.Forms.UserControl ControlIn)
 {
     ControlIn.Width  = _Till_.Program.Width;
     ControlIn.Height = panel1.Height;
     panel1.Controls.Clear();
     panel1.Controls.Add(ControlIn);
     panel1.Update();
 }
Ejemplo n.º 38
0
        /// <summary>
        ///     Recurs <c>UserControl</c> to change.
        /// </summary>
        /// <param name="parent">
        ///     <c>UserControl</c> object to scan.
        /// </param>
        private void RecurUserControl(System.Windows.Forms.UserControl userControl)
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(userControl.GetType());

            RecurControls(userControl, resources);

            // addition suggested by Piotr Sielski:
            ScanNonControls(userControl, resources);
        }
Ejemplo n.º 39
0
 public void changeUC(System.Windows.Forms.UserControl user, Panel pnl)
 {
     foreach (System.Windows.Forms.UserControl item in pnl.Controls.OfType <System.Windows.Forms.UserControl>())
     {
         pnl.Controls.Remove(item);
     }
     user.Dock = DockStyle.Fill;
     pnl.Controls.Add(user);
 }
Ejemplo n.º 40
0
 public void change(System.Windows.Forms.UserControl user)
 {
     user.Dock = DockStyle.Fill;
     Index.Indexs.panel.Controls.Add(user);
     foreach (System.Windows.Forms.UserControl item in Index.Indexs.panel.Controls.OfType <System.Windows.Forms.UserControl>())
     {
         Index.Indexs.panel.Controls.Remove(item);
     }
 }
Ejemplo n.º 41
0
        public static void showParentForm(System.Windows.Forms.UserControl uc)
        {
            Form parentForm = (uc.ParentForm as Form);

            if (parentForm != null)
            {
                parentForm.Show(); //show formDialog cha hien thi len
            }
        }
Ejemplo n.º 42
0
        public static void disposeParentForm(System.Windows.Forms.UserControl uc)
        {
            Form parentForm = (uc.ParentForm as Form);

            if (parentForm != null)
            {
                parentForm.Dispose(); // giai phong formDialog
            }
        }
Ejemplo n.º 43
0
        public static void hidenParentForm(System.Windows.Forms.UserControl uc)
        {
            Form parentForm = (uc.ParentForm as Form);

            if (parentForm != null)
            {
                parentForm.Hide(); // formDialog cha di
            }
        }
Ejemplo n.º 44
0
        //public static MOT.CustomTaskPane GetTaskPane(System.Windows.Forms.UserControl taskPane, string name, MOT.CustomTaskPaneCollection customTaskPanes, string Hwnd)
        //{
        //    MOT.CustomTaskPane ctp = default(MOT.CustomTaskPane);

        //    //PLLog.Trace3("Enter", Common.LOG_CATEGORY);

        //    string key = string.Format("{0}({1})", name, Hwnd);

        //    if (_CreatedPanes.ContainsKey(key))
        //    {
        //        ctp = _CreatedPanes[key];
        //    }
        //    else
        //    {
        //        ctp = customTaskPanes.Add(taskPane, name);
        //        ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight;
        //        //ctp.Visible = true;
        //    }

        //    //PLLog.Trace3("Exit", System.Data.Common.LOG_CATEGORY);
        //    return ctp;
        //}

        public static MOT.CustomTaskPane AddTaskPane(System.Windows.Forms.UserControl taskPane, string name, MOT.CustomTaskPaneCollection customTaskPanes)
        {
            MOT.CustomTaskPane ctp = default(MOT.CustomTaskPane);

            //PLLog.Trace3("Enter", Common.LOG_CATEGORY);

            ctp = customTaskPanes.Add(taskPane, name);
            ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight;
            ctp.Visible      = true;

            //PLLog.Trace3("Exit", System.Data.Common.LOG_CATEGORY);
            return(ctp);
        }
Ejemplo n.º 45
0
        private void btnContactHis_Click(object sender, EventArgs e)
        {
            if (teCustCode.Text != "")
            {
                string[] args = new string[9];

                args[0] = strUserID;
                args[1] = strDeptCode;
                args[2] = ""; // ibs 고객정보열람에서 매출/수금탭 고정
                args[3] = strUpdateAuth;
                args[4] = strDeleteAuth;
                args[5] = strSearchAuth;
                args[6] = strPrintAuth;
                args[7] = strExcelAuth;
                args[8] = strDataAuth;

                bool   bModal      = true;
                int    iFormWidth  = 1010;
                int    iFormHeight = 670;
                string MenuName    = "고객상세정보";
                //string sFilePath = "NSIM.MasterMgmt.dll";
                //string sNameSpace = "NSIM.MasterMgmt.ClientInfo";
                //string sClass = "ClientInfoView";
                string sParam = teCustCode.Text;
                string sPath  = "C:/Program Files/CESNET2.0/NSIMNew/NSIM.MasterMgmt.dll";

                CES.FUNCTION.CESAssembly cesAssem = new CES.FUNCTION.CESAssembly();
                object control = cesAssem.LoadAssembly(sPath, "NSIM.MasterMgmt.ClientInfo.ClientInfoView", args);

                System.Reflection.Assembly assem = System.Reflection.Assembly.LoadFrom("C:/Program Files/CESNET2.0/NSIMNew/NSIM.MasterMgmt.dll");
                //assem.CreateInstance("NSIM.MasterMgmt.ClientInfo.ClientInfoView", false, System.Reflection.BindingFlags.CreateInstance, null, args, null, null);
                System.Windows.Forms.UserControl ctrl = (System.Windows.Forms.UserControl)assem.CreateInstance("NSIM.MasterMgmt.ClientInfo.ClientInfoView", false, System.Reflection.BindingFlags.CreateInstance, null, args, null, null);
                ctrl.Dock = System.Windows.Forms.DockStyle.Fill;
                ctrl.Tag  = sParam;

                Form frm = new Form();
                frm.Controls.Add(ctrl);
                frm.Size          = new System.Drawing.Size(iFormWidth, iFormHeight);
                frm.Text          = MenuName;
                frm.StartPosition = FormStartPosition.CenterParent;

                if (bModal)
                {
                    frm.ShowDialog();
                }
                else
                {
                    frm.ShowDialog();
                }
            }
        }
Ejemplo n.º 46
0
        /// <summary>
        /// 修改款式尺寸动态加载
        /// </summary>
        /// <param name="form"></param>
        //        public static void ReviseLoadChiCunCard(ReviseStyle form)
        //        {
        //            DataTable dt = SQLmtm.GetDataTable("SELECT\n" +
        //" sp.FIT_ITEM_VALUE,\n" +
        //" property.PROPERTY_CD propertyCd,\n" +
        //"/*量体属性CD*/\n" +
        //"property.PROPERTY_VALUE propertyValue,\n" +
        //"/*量体VALUE*/\n" +
        //" sp.ITEM_IN_FROM propertyInFrom,\n" +
        //"/*量体属性值可增加范围从*/\n" +
        //" sp.ITEM_IN_TO propertyInTo,\n" +
        //"/*量体属性值可增加范围到*/\n" +
        //" sp.ITEM_OUT_FROM propertyOutFrom,\n" +
        //"/*量体属性值可缩减范围从*/\n" +
        //" sp.ITEM_OUT_TO propertyOutTo,\n" +
        //"/*量体属性值可缩减范围到*/\n" +
        //" property.PROPERTY_NAME_CN propertyNameCn,\n" +
        //"/*量体属性中文名称*/\n" +
        //" property.FIT_USE_TYPE_CD fitUseTypeCd,\n" +
        //"/*0-非净量体,1-净量体*/\n" +
        //" property.PROPERTY_UNIT_CD propertyUnitCd ,\n" +
        //" sp.ITEM_SORT,\n" +
        //" sp.ITEM_CD,\n" +
        //" sp.ITEM_VALUE\n" +
        //"FROM\n" +
        //" a_fit_property_p property\n" +
        //" LEFT JOIN a_size_fit_p sp ON property.PROPERTY_CD = sp.ITEM_CD \n" +
        //" AND property.PROPERTY_VALUE = sp.ITEM_VALUE \n" +
        //"WHERE\n" +
        //" property.PROPERTY_CD IN ( SELECT PROPERTY_VALUE FROM a_fit_property_p WHERE style_category_cd = '" + ReviseStyle.sTYLE_CATEGORY_CD + "' ) \n" +
        //" AND property.DEL_FLG = 0 \n" +
        //"  AND sp.FIT_CD = '" + ReviseStyle.sTYLE_FIT_CD + "'  /*款式*/\n" +
        //" AND sp.SIZEGROUP_CD = '" + ReviseStyle.sTYLE_SIZE_GROUP_CD + "' \n" +
        //"-- AND sp.SIZE_CD = '" + ReviseStyle.sTYLE_SIZE_CD + "'   /*尺码*/\n" +
        //" AND property.FIT_USE_TYPE_CD = \"FIT_USE_TYPE-FIT_TYPE_20\" \n" +
        //" AND sp.ENABLE_FLAG = 1 \n" +
        //" AND property.FIT_FLAG = 1 \n" +
        //" AND sp.ITEM_VALUE != \"CIRCU_ITEM_09\" \n" +
        //"GROUP BY property.PROPERTY_VALUE  \n" +
        //"ORDER BY\n" +
        //" -- property.PROPERTY_CD,sp.ITEM_SORT ASC\n" +
        //" sp.ITEM_SORT ASC");
        //            //form.panel3.Controls.Clear();
        //            height = 0;
        //            width = 0;
        //            int i = 0;
        //            panelLocition = new PanelLocition(form.panel4.Width, form.panel4.Height, dt.Rows.Count);
        //            ChiCunHead hhh = new ChiCunHead();
        //            ImpService.generateUserControl(hhh, i);
        //            form.panel4.Controls.Add(hhh);
        //            i++;
        //            foreach (DataRow dr in dt.Rows)
        //            {
        //                ChiCunCard ccc = new ChiCunCard(dr["ITEM_CD"].ToString().Trim(), dr["ITEM_VALUE"].ToString(), dr["propertyNameCn"].ToString(), dr["FIT_ITEM_VALUE"].ToString(), form);
        //                ImpService.generateUserControl(ccc, i);
        //                form.panel4.Controls.Add(ccc);//将控件加入panel

        //                i++;
        //            }
        //            DataTable dtt = SQLmtm.GetDataTable("SELECT\n" +
        //"	*,\n" +
        //"	SUBSTRING_INDEX( ap.REMARKS, ',', 1 )AS pv1,\n" +
        //"	SUBSTRING_INDEX( ap.REMARKS, ',', -1 )AS pv2\n" +
        //"FROM\n" +
        //"	a_customer_fit_r ar\n" +
        //"	LEFT JOIN a_fit_property_p ap ON ar.ITEM_VALUE = ap.PROPERTY_VALUE \n" +
        //"WHERE\n" +
        //"	FIT_COUNT_ID = '" + CreateCustomer.customer_countid + "'");
        //            foreach (Control card in form.panel4.Controls)
        //            {
        //                if (card is ChiCunCard)
        //                {
        //                    ChiCunCard c = (ChiCunCard)card;
        //                    foreach (DataRow dr in dtt.Rows)
        //                    {
        //                        if (c.fIT_ITEM_VALUE == dr["ITEM_VALUE"].ToString())
        //                        //if (dr["pv1"].ToString() == card.iTEM_VALUE || dr["pv2"].ToString() == card.iTEM_VALUE)
        //                        {
        //                            c.kehu.Text = dr["FIT_VALUE"].ToString();
        //                            c.tiaozheng.Text = dr["FIT_VALUE_CALCULATE"].ToString();
        //                        }
        //                    }
        //                }
        //            }
        //        }

        public static void generateUserControl(System.Windows.Forms.UserControl userControl, int i)
        {
            userControl.Name = "chicuncard" + i.ToString();
            //userControl.Size = new Size(200, 30);
            //if (i != 0)
            //{
            //    if (i % 5 == 0)
            //    {
            //        width = 0;
            //        height = height + 240;
            //    }
            //}
            userControl.Location = new System.Drawing.Point(panelLocition.UcLeft + width, panelLocition.UcHeight + height * 33);//控件位置
            height++;
        }
Ejemplo n.º 47
0
 private static void ArrayUC(System.Windows.Forms.UserControl userControl, int i)
 {
     userControl.Name = "shejidiancard" + i.ToString();
     //userControl.Size = new Size(200, 30);
     if (i != 0)
     {
         if (i % 16 == 0)
         {
             width  = width + 600;
             height = 0;
         }
     }
     userControl.Location = new System.Drawing.Point(panelLocition.UcLeft + width, panelLocition.UcHeight + height * 50);//控件位置
     height++;
 }
Ejemplo n.º 48
0
        public void SetMenuEnable(bool bEnable)
        {
            List <IContent> allConents = UCService.AllContents;

            if (allConents != null)
            {
                foreach (IContent c in allConents)
                {
                    if (c is System.Windows.Forms.UserControl && c is IPadContent)
                    {
                        System.Windows.Forms.UserControl uc = c as System.Windows.Forms.UserControl;
                        uc.Enabled = bEnable;
                    }
                }
            }
            this.ribbon.Enabled = bEnable;
        }
Ejemplo n.º 49
0
 public static void setPane(System.Windows.Forms.UserControl _pane)
 {
     try
     {
         foreach (System.Windows.Forms.Control _ctr in _pane.Controls)
         {
             if (_ctr is System.Windows.Forms.Button)
             {
                 _ctr.Text = Resources.Labels.ResourceManager.GetString(_ctr.Name);
             }
         }
     }
     catch (Exception E)
     {
         System.Windows.Forms.MessageBox.Show("Localization error: " + E.Message + ". I don't know what you did, but it's not funny. Please, contact application administrator.", "WooTable .::. Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 50
0
        /// <summary>
        /// 消除frame中panel往父控件上靠时的闪烁现象
        /// </summary>
        /// <param name="frame"></param>
        private void ClearFramesOfPanelParent(UserControl frame)
        {
            //测试时间

            foreach (Control tempUserControl in PanelFrameParent.Controls)
            {
                if (tempUserControl is System.Windows.Forms.UserControl && tempUserControl != frame)
                {
                    System.Windows.Forms.UserControl userControl = (System.Windows.Forms.UserControl)tempUserControl;
                    PanelFrameParent.Controls.Remove(userControl);
                    if (!userControl.IsDisposed)
                    {
                        userControl.Dispose();
                    }
                }
            }
        }
Ejemplo n.º 51
0
Archivo: View.cs Proyecto: whuacn/CJia
        /// <summary>
        /// 以窗口形式显示
        /// </summary>
        /// <param name="Caption"></param>
        /// <param name="UControl"></param>
        public void ShowAsWindow(string Caption, System.Windows.Forms.UserControl UControl)
        {
            System.Windows.Forms.Form frmBase = new System.Windows.Forms.Form();
            frmBase.Text            = Caption;
            frmBase.FormBorderStyle = FormBorderStyle.FixedDialog;
            frmBase.MaximizeBox     = false;
            frmBase.MinimizeBox     = false;

            frmBase.Size          = new System.Drawing.Size(UControl.Width + 15, UControl.Height + 30);
            frmBase.AutoSize      = true;
            frmBase.StartPosition = FormStartPosition.CenterScreen;
            frmBase.KeyPreview    = true;
            //UControl.Dock = DockStyle.Fill;
            frmBase.Controls.Add(UControl);
            //UControl.Parent = frmBase;
            UControl.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Top);
            frmBase.ShowDialog();
        }
Ejemplo n.º 52
0
        /// <summary>
        /// 添加项目显示录入UC
        /// </summary>
        /// <returns>成功返回1 失败返回-1</returns>
        public int AddItemInputUC(System.Windows.Forms.UserControl ucItemInput)
        {
            if (ucItemInput == null)
            {
                this.panelItemManager.Visible = false;
            }
            else
            {
                this.panelItemManager.Controls.Clear();

                this.panelItemManager.Controls.Add(ucItemInput);

                this.panelItemManager.Size = ucItemInput.Size;

                ucItemInput.Dock = DockStyle.Fill;
            }

            return(1);
        }
Ejemplo n.º 53
0
        public DialogShellView(System.Windows.Forms.UserControl hostedControl)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            m_HostedControl = hostedControl;

            this.SuspendLayout();;
            this.m_HostedControl.SuspendLayout();
            this.ClientSize = new System.Drawing.Size(m_HostedControl.Size.Width, m_HostedControl.Size.Height + this.m_ButtonPanel.Size.Height);
            this.Controls.Add(hostedControl);
            hostedControl.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
            this.m_HostedControl.ResumeLayout(false);
            this.ResumeLayout(false);

            this.m_HostedControl.SizeChanged += new EventHandler(m_HostedControl_SizeChanged);
        }
Ejemplo n.º 54
0
        public MhoraSplitContainer(System.Windows.Forms.UserControl _mControl)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitForm call
            mControl1      = _mControl;
            mControl1.Dock = DockStyle.Fill;
            this.Controls.Add(mControl1);
            sp           = new Splitter();
            sp.BackColor = Color.LightGray;
            sp.Dock      = DockStyle.Left;
            DrawDock     = DrawStyle.LeftRight;
            nItems       = 1;

            this.Dock  = DockStyle.Fill;
            sp.Height += 2;
            sp.Width  += 2;
        }
Ejemplo n.º 55
0
        public override System.Windows.Forms.UserControl WizardNextPage(System.Windows.Forms.UserControl currentPage)
        {
            WizardPage wizardPage = currentPage as WizardPage;

            if (wizardPage != null)
            {
                _newDSScale = wizardPage.GetDataScale();

                int errors = 0;
                _newDSSymbols = wizardPage.GetSymbolsDescription(ref errors);

                if (errors > 0)
                {
                    MessageBox.Show(string.Format("В формате имени одного или нескольких инструментов была допущена ошибка. Всего ошибок: {0}.", errors),
                                    "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            return(null);
        }
Ejemplo n.º 56
0
        public FrameworkElementUITypeEditor(Property property, FrameworkEditorBindableProperty bindableProperty)
        {
            Guard.ArgumentNotNull(bindableProperty, "bindableProperty");

            this.property = property;

            FrameworkElement editorInstance = bindableProperty.CreateEditorInstance();

            editorInstance.DataContext = bindableProperty;
            scrollViewer = new ScrollViewer {
                HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch
            };
            scrollViewer.Content = editorInstance;
            host = new ElementHost {
                Child = scrollViewer, Dock = DockStyle.Fill
            };

            host.Resize  += HostResize;
            hostContainer = new Winforms.UserControl();
            hostContainer.Controls.Add(host);
        }
Ejemplo n.º 57
0
 // Sử dụng 4 đối số truyền vào cho hàm này gồm có:
 //1> DevExpress.XtraTab.XtraTabControl XtraTabCha : Tạm gọi là Tab Cha vì XtraTabControl này để mình quăng tabcon vào
 //2> string icon : Khi add Tab con vào Tab cha thì đối số này để quy định icon hình cho tabCon(XtraTabpage)
 //3> string TabNameAdd : Khi add tab con vào thì đối số này quy định tên của Tabcon vừa Add vào đó.
 //4> System.Windows.Forms.UserControl UserControl: Cái này dùng để Add cái UserControl do ta tạo vào Tabcon
 public void AddTab(DevExpress.XtraTab.XtraTabControl XtraTabCha, string icon, string TabNameAdd, System.Windows.Forms.UserControl UserControl)
 {
     // Khởi tạo 1 Tab Con (XtraTabPage)
     DevExpress.XtraTab.XtraTabPage TAbAdd = new DevExpress.XtraTab.XtraTabPage();
     // Đặt đại cái tên cho nó là TestTab
     TAbAdd.Name = "TestTab";
     // Tên của nó là đối số như đã nói ở trên
     TAbAdd.Text = TabNameAdd;
     // Add đối số UserControl vào Tab con vừa khởi tạo ở trên
     TAbAdd.Controls.Add(UserControl);
     // Dock cho nó tràn hết TAb con đó
     UserControl.Dock = DockStyle.Fill;
     try
     {
         // Icon của Tab con khi add vào Tab cha sẽ được quy định ở đây(^^Ở đây là k sử dụng Icon^^)
         TAbAdd.Image = System.Drawing.Bitmap.FromFile(System.Windows.Forms.Application.StartupPath.ToString() + @"\Icons\" + icon);
     }
     catch (Exception ex)
     {
     }
     // Quăng nó lên TAb Cha
     XtraTabCha.TabPages.Add(TAbAdd);
 }
Ejemplo n.º 58
0
 // Sử dụng 4 đối số truyền vào cho hàm này gồm có:
 //1> DevExpress.XtraTab.XtraTabControl XtraTabCha : Tạm gọi là Tab Cha vì XtraTabControl này để mình quăng tabcon vào
 //2> string icon : Khi add Tab con vào Tab cha thì đối số này để quy định icon hình cho tabCon(XtraTabpage)
 //3> string TabNameAdd : Khi add tab con vào thì đối số này quy định tên của Tabcon vừa Add vào đó.
 //4> System.Windows.Forms.UserControl UserControl: Cái này dùng để Add cái UserControl do ta tạo vào Tabcon
 public void AddTab(DevExpress.XtraTab.XtraTabControl XtraTab, string TabNameAdd, System.Windows.Forms.UserControl UserControl)
 {
     // Khởi tạo 1 Tab Con (XtraTabPage)
     DevExpress.XtraTab.XtraTabPage TAbAdd = new DevExpress.XtraTab.XtraTabPage();
     // Đặt đại cái tên cho nó là TestTab
     TAbAdd.Name = "TestTab";
     // Tên của nó là đối số như đã nói ở trên
     TAbAdd.Text = TabNameAdd;
     // Add đối số UserControl vào Tab con vừa khởi tạo ở trên
     TAbAdd.Controls.Add(UserControl);
     // Dock cho nó tràn hết TAb con đó
     UserControl.Dock = DockStyle.Fill;
     // Quăng nó lên TAb Cha
     XtraTab.TabPages.Add(TAbAdd);
 }
 /// <summary>
 /// This procedure registers this very ExtenderProvider System.Object to its host.
 ///
 /// </summary>
 /// <returns>void</returns>
 private void RegisterExtenderProvider(System.Windows.Forms.UserControl AUserControl)
 {
     // TODO RegisterExtenderProvider
 }
 /// <summary>
 /// This procedure checks for the ExtenderProvider System.Object in its host. If
 /// the UserControl contains this type of ExtenderProvider it returns TRUE,
 /// if not it returns FALSE.
 ///
 /// </summary>
 /// <returns>void</returns>
 private bool CheckForExtenderProvider(System.Windows.Forms.UserControl AUserControl)
 {
     // TODO CheckForExtenderProvider
     return(false);
 }