コード例 #1
0
        protected override void InitControls()
        {
            this.Text            = "Browse for Folder and File";
            this.Width           = 500;
            this.Height          = 400;
            this.BackColor       = ColorTool.White;
            this.StartUpPosition = WindowsStartupPosition.CenterScreen;
            this._TextPath       = new NativeTextBox();

            this._TextPath.Left   = 10;
            this._TextPath.Top    = 10;
            this._TextPath.Width  = 200;
            this._TextPath.Height = 20;
            this._TextPath.Style |= WindowStylesConst.WS_BORDER;

            this._PathSelectButton          = new NativeButton();
            this._PathSelectButton.Left     = this._TextPath.Left + this._TextPath.Width + 2;
            this._PathSelectButton.Top      = this._TextPath.Top;
            this._PathSelectButton.Width    = 30;
            this._PathSelectButton.Height   = 20;
            this._PathSelectButton.Text     = "…";
            this._PathSelectButton.Clicked += PathSelectButton_Click;

            this.Controls.Add(this._TextPath);
            this.Controls.Add(this._PathSelectButton);
        }
コード例 #2
0
 public RichTextBox2()
     : base()
 {
     dpix         = 0;
     native       = null;
     m_zoomfactor = 1.0f;
     //            SendMessage(this.Handle, EM_SETEDITSTYLE, SES_SCROLLONKILLFOCUS, (IntPtr)SES_SCROLLONKILLFOCUS);
 }
コード例 #3
0
 protected override void Dispose(bool disposing)
 {
     if (native != null)
     {
         native.ReleaseHandle();
         native = null;
     }
     base.Dispose(disposing);
 }
コード例 #4
0
        public void EnableCleverness()
        {
            if (native != null)
            {
                throw new Exception("Cleverness already enabled");
            }
            if (Parent == null)
            {
                throw new Exception("Cleverness requires parent");
            }
            if (Parent.Handle != GetParent(Handle))
            {
                throw new Exception("Unusual parent shenanigans");
            }
            native = new NativeTextBox(Parent);
            SetStyle(ControlStyles.EnableNotifyMessage, true);

            Int32 mask = SendMessage(this.Handle, EM_GETEVENTMASK, 0, (IntPtr)0);

            mask |= (ENM_REQUESTRESIZE | ENM_OBJECTPOSITIONS);

            SendMessage(this.Handle, EM_SETEVENTMASK, 0, (IntPtr)mask);
        }
コード例 #5
0
        protected override void Initialize()
        {
            base.Initialize();
            Debug.Print(this.Width.ToString());

            this._TextBox        = new NativeTextBox();
            this._Button         = new NativeButton();
            this._TextBox.Width  = this.Width - 20;
            this._TextBox.Height = this.Height;
            this._TextBox.Left   = 0;
            this._TextBox.Top    = 0;
            this._TextBox.Name   = "CONTROL_TEST_TXT";
            this._Button.Width   = 20;
            this._Button.Height  = this.Height;
            this._Button.Left    = this._TextBox.Width;
            this._Button.Top     = 0;
            this._Button.Name    = "CONTROL_TEST_BT";
            this._Button.Text    = "...";

            this._Button.Clicked += Button_Clicked;
            this.Controls.Add(this._TextBox);
            this.Controls.Add(this._Button);
        }
コード例 #6
0
        protected override void InitControls()
        {
            this.Text            = "Configuration Editor";
            this.Width           = 480;
            this.Height          = 430;
            this.IconFile        = "App.ico";
            this.StartUpPosition = WindowsStartupPosition.CenterScreen;

            int top       = 10;
            int leftLeft  = 10;
            int rightLeft = 120;


            this._ChkContextMenu = new NativeCheckBox
            {
                Location = new Point(leftLeft, top),
                Width    = 100,
                Height   = 20,
                Text     = "Context-Menu",
            };
            this._ChkContextMenu.Style |= WindowStylesConst.WS_TABSTOP;
            this._ChkDevTools           = new NativeCheckBox
            {
                Location = new Point(rightLeft, top),
                Width    = 100,
                Height   = 20,
                Text     = "Dev-Tools"
            };

            this._ChkStatusBar = new NativeCheckBox
            {
                Location = new Point(rightLeft + 110, top),
                Width    = 100,
                Height   = 20,
                Text     = "Statusbar"
            };


            this._ChkAppStatusBar = new NativeCheckBox
            {
                Location = new Point(this._ChkStatusBar.Left + this._ChkStatusBar.Width + 10, top),
                Width    = 100,
                Height   = 20,
                Text     = "App-Statusbar"
            };

            top += 30;
            NativeLabel lblTitle = new NativeLabel
            {
                Location  = new Point(leftLeft, top),
                Width     = 100,
                Height    = 20,
                Text      = "Title:",
                BackColor = this.BackColor
            };

            this._TxtTitle = new NativeTextBox
            {
                Location = new Point(rightLeft, top),
                Width    = 300,
                Height   = 20,
            };
            this._TxtTitle.Style |= WindowStylesConst.WS_BORDER;


            top += 30;
            NativeLabel lblUrl = new NativeLabel
            {
                Location  = new Point(leftLeft, top),
                Width     = 100,
                Height    = 20,
                Text      = "Url:",
                BackColor = this.BackColor
            };

            this._TxtUrl = new NativeTextBox
            {
                Location = new Point(rightLeft, top),
                Width    = 300,
                Height   = 20
            };
            this._TxtUrl.Style |= WindowStylesConst.WS_BORDER;


            top += 30;
            NativeLabel lblUserFolder = new NativeLabel
            {
                Location  = new Point(leftLeft, top),
                Width     = 100,
                Height    = 20,
                Text      = "Data-Folder:",
                BackColor = this.BackColor
            };

            this._TxtUserDataFolder = new NativeTextBox
            {
                Location = new Point(rightLeft, top),
                Width    = 300,
                Height   = 20
            };
            this._TxtUserDataFolder.Style |= WindowStylesConst.WS_BORDER;

            this._BnSelectUserDataFolder = new NativeButton
            {
                Location = new Point(rightLeft + 301, top),
                Width    = 25,
                Height   = 20,
                Text     = "…"
            };
            this._BnSelectUserDataFolder.Clicked += BnSelectUserDataFolder_Clicked;

            top += 30;
            NativeLabel lblBrowserExecutable = new NativeLabel
            {
                Location  = new Point(leftLeft, top),
                Width     = 100,
                Height    = 20,
                Text      = "Browser-Folder:",
                BackColor = this.BackColor
            };

            this._TxtBrowserExecutable = new NativeTextBox
            {
                Location = new Point(rightLeft, top),
                Width    = 300,
                Height   = 20
            };
            this._TxtBrowserExecutable.Style |= WindowStylesConst.WS_BORDER;

            this._BnSelectBrowserExecutable = new NativeButton
            {
                Location = new Point(rightLeft + 301, top),
                Width    = 25,
                Height   = 20,
                Text     = "…"
            };
            this._BnSelectBrowserExecutable.Clicked += BnSelectBrowserExecutable_Clicked;

            top += 30;
            this._ChkMonitoring = new NativeCheckBox
            {
                Location = new Point(leftLeft, top),
                Width    = 100,
                Height   = 20,
                Text     = "Monitoring"
            };

            top += 30;
            NativeLabel lblMonitoriingUrl = new NativeLabel
            {
                Location  = new Point(leftLeft, top),
                Width     = 100,
                Height    = 20,
                Text      = "Monitoring-Url:",
                BackColor = this.BackColor
            };

            this._TxtMonitoringUlr = new NativeTextBox
            {
                Location = new Point(rightLeft, top),
                Width    = 300,
                Height   = 20
            };
            this._TxtMonitoringUlr.Style |= WindowStylesConst.WS_BORDER;

            top += 30;
            NativeLabel lblMonitoriingPath = new NativeLabel
            {
                Location  = new Point(leftLeft, top),
                Width     = 100,
                Height    = 20,
                Text      = "Monitoring-Path:",
                BackColor = this.BackColor
            };

            this._TxtMonitoringPath = new NativeTextBox
            {
                Location = new Point(rightLeft, top),
                Width    = 300,
                Height   = 20
            };
            this._TxtMonitoringPath.Style |= WindowStylesConst.WS_BORDER;

            this._BnSelectMonitoringPath = new NativeButton
            {
                Location = new Point(rightLeft + 301, top),
                Width    = 25,
                Height   = 20,
                Text     = "…"
            };
            this._BnSelectMonitoringPath.Clicked += BnSelectMonitoringPath_Click;

            top       += 30;
            this._BnOk = new NativeButton
            {
                Width    = 80,
                Height   = 25,
                Location = new Point(this.Width - 33 - 81, top),
                Text     = "&Ok"
            };
            this._BnOk.Clicked += BnOk_Clicked;
            this._BnCancel      = new NativeButton
            {
                Width    = 80,
                Height   = 25,
                Location = new Point(this._BnOk.Left - 10 - 80, top),
                Text     = "&Cancel"
            };
            this._BnCancel.Clicked += BnCancel_Clicked;
            top        += 80;
            this.Height = top;
            this.Controls.Add(this._BnOk);
            this.Controls.Add(this._ChkContextMenu);
            this.Controls.Add(this._ChkDevTools);
            this.Controls.Add(this._ChkStatusBar);
            this.Controls.Add(this._ChkAppStatusBar);
            this.Controls.Add(lblTitle);
            this.Controls.Add(this._TxtTitle);
            this.Controls.Add(lblUrl);
            this.Controls.Add(this._TxtUrl);
            this.Controls.Add(lblUserFolder);
            this.Controls.Add(this._TxtUserDataFolder);
            this.Controls.Add(this._BnSelectUserDataFolder);
            this.Controls.Add(lblBrowserExecutable);
            this.Controls.Add(this._TxtBrowserExecutable);
            this.Controls.Add(this._BnSelectBrowserExecutable);
            this.Controls.Add(this._ChkMonitoring);
            this.Controls.Add(lblMonitoriingUrl);
            this.Controls.Add(this._TxtMonitoringUlr);
            this.Controls.Add(lblMonitoriingPath);
            this.Controls.Add(this._TxtMonitoringPath);
            this.Controls.Add(this._BnSelectMonitoringPath);

            this.Controls.Add(this._BnCancel);
        }
コード例 #7
0
        protected override void InitControls()
        {


            this.Text = CAPTION;
            this.Name = "Window1";
            //this.StatusBar = false;
            // this.Left = 100;
            //this.Top = 100;
            this.Width = 600;
            this.Height = 400;
            
            this._ControlTest = new ControlTest();
            this._ControlTest.Width = 200;
            this._ControlTest.Height = 30;
            this._ControlTest.Left = 300;
            this._ControlTest.Top = 80;
            this._ControlTest.Name = "TEST_CONTAINER";
            
            //this.BackColor = ColorTool.LightGray;
            this.StartUpPosition = WindowsStartupPosition.CenterScreen;
            this.BackColor = ColorTool.White;
            this._Timer = new NativeTimer();
            this._Timer.Interval = 100;
            //this._Timer.ControlId = 700;
            this._Timer.Tick += Timer_OnTick;
            this._Button = new NativeButton
            {
                Left = 10,
                Top = 10,
                Width = 100,
                Height = 30,
                Text = "Test",
                Name = "bnTest",
                BackColor = ColorTool.Blue,
                ForeColor = ColorTool.Green

            };

            this._Button1 = new NativeButton
            {
                Left = 150,
                Top = 10,
                Width = 100,
                Height = 30,
                Text = "Test",
                Name = "bnTest"//,
                //ControlId = 505
            };
            this._Button.Clicked += button_OnClicked;
            this._Button.DblClicked += button_OnDblClicked;
            this._Button1.Clicked += button1_OnClicked;
            this._Button1.DblClicked += button1_OnDblClicked;

            this._Button3 = new NativeButton
            {
                Location = new Point(300, 10),
                Width = 20,
                Height = 30,
                Name = "SelectFolder",
                Text = "…"
            };

            this._Button3.Clicked += Button3_Click;
            this._ComboBox = new NativeComboBox();
            this._ComboBox.Location = new Point(350, 10);
            
            this._ComboBox.Height = 30;
            this._ComboBox.Width = 200;
            this._ComboBox.Name = "cbbTest";
            this._ComboBox.ForeColor = ColorTool.Blue;
            this._ComboBox.BackColor = ColorTool.Green;
            this._ComboBox.Font = new Font() { Name = "Arial", Size = 10 };
            this._ComboBox.SelChange += ComboBox_SelChange;


            this._TextBox = new NativeTextBox
            {
                Left = 10,
                Top = 50,
                Width = 100,
                Height = 30,
                Text = "ATEST",
                Name = "txtTest",
                Font = new Font() { Name = "Arial", Size = 14 },
                ForeColor = ColorTool.Read
                //ControlId = 502
            };
            this._TextBox.Change += TextBox_Change;

            this._TextBox2 = new NativeTextBox
            {
                Left = 10,
                Top = 150,
                Width = 100,
                Height = 30,
                Text = "",
                Name = "txt2Test",
                //ControlId = 503,
                BackColor = ColorTool.Black,
                ForeColor = ColorTool.White

            };

            this._Label1 = new NativeLabel
            {
                Left = 10,
                Top = 200,
                Width = 100,
                Height = 30,
                Text = "Dies ist ein Label"//,
                                           //BackColor=ColorTool.Read,
                                           //ForeColor = ColorTool.Green,
                                           //ControlId = 504

            };
            this._Label1.Clicked += Label1_Click;
            this._Label1.DblClicked += Label1_DblClick;

            this._Bitmap = new NativeBitmap();
            this._Bitmap.BitMap = "Skype.bmp";
            this._Bitmap.Left = 150;
            this._Bitmap.Top = 50;
            this._Bitmap.Width = 100;
            this._Bitmap.Height = 100;

            this._CheckBox = new NativeCheckBox();
            this._CheckBox.Left = 300;
            this._CheckBox.Top = 50;
            this._CheckBox.Width = 200;
            this._CheckBox.Height = 30;
            this._CheckBox.Text = "TEST CHECKBOX";
            this._CheckBox.BackColor = ColorTool.White;
            this._CheckBox.Checked = true;

            this._ListBox = new NativeListBox();
            this._ListBox.Left = 300;
            this._ListBox.Top = 200;
            this._ListBox.Width = 400;
            this._ListBox.Height = 400;
            this._ListBox.BackColor = ColorTool.Yellow;
            this._ListBox.ForeColor = ColorTool.Read;
            this._ListBox.Font = new Font() { Name = "Arial", Size = 16 };
            this._ListBox.MultiSelect = true;
            this._ListBox.DblClicked+=ListBox_DblClicked;
            
            this._ListBox.SelChange+=ListBox_SelChange;

            this._ProgressBar = new NativeProgress
            {
                Left = 10,
                Top = 250,
                Width = 150,
                Height = 30//,
                //ControlId = 507
            };



            this._TextBox.Clicked += TextBox_Click;
            
            this.Controls.Add(this._Button);
            this.Controls.Add(this._Button1);
            this.Controls.Add(this._Button3);
            this.Controls.Add(this._ComboBox);
            this.Controls.Add(this._TextBox);
            this.Controls.Add(this._TextBox2);
            this.Controls.Add(this._Label1);
            this.Controls.Add(this._Bitmap);
            this.Controls.Add(this._CheckBox);
            this.Controls.Add(this._ListBox);
            this.Controls.Add(this._ProgressBar);
            this.Controls.Add(this._Timer);
            this.Controls.Add(this._ControlTest);
            Click += Window1_Click;
            DoubleClick += Window1_DblClick;
            Create += Window1_Create;
            this.MouseMove += Window1_MoseMove;
        }
コード例 #8
0
ファイル: RichTextBox2.cs プロジェクト: ArsenShnurkov/Tree
 protected override void Dispose(bool disposing)
 {
     if (native != null)
     {
         native.ReleaseHandle();
         native = null;
     }
     base.Dispose(disposing);
 }
コード例 #9
0
ファイル: RichTextBox2.cs プロジェクト: ArsenShnurkov/Tree
        public void EnableCleverness()
        {
            if (native != null)
                throw new Exception("Cleverness already enabled");
            if (Parent == null)
                throw new Exception("Cleverness requires parent");
            if (Parent.Handle != GetParent(Handle))
                throw new Exception("Unusual parent shenanigans");
            native = new NativeTextBox(Parent);
            SetStyle(ControlStyles.EnableNotifyMessage, true);

            IntPtr mask = SendMessage(native.Handle, EM_GETEVENTMASK, (IntPtr)0, (IntPtr)0); //THE KEY LINE THAT FIXES THE 64-BIT VERSION
            mask = (IntPtr)((Int32)mask | (ENM_REQUESTRESIZE | ENM_OBJECTPOSITIONS));

            SendMessage(this.Handle, EM_SETEVENTMASK, (IntPtr)0, mask);
        }
コード例 #10
0
ファイル: RichTextBox2.cs プロジェクト: ArsenShnurkov/Tree
 public RichTextBox2()
     : base()
 {
     dpix = 0;
     native = null;
     m_zoomfactor = 1.0f;
     //            SendMessage(this.Handle, EM_SETEDITSTYLE, SES_SCROLLONKILLFOCUS, (IntPtr)SES_SCROLLONKILLFOCUS);
 }