A windows that Sticks to other windows of the same type when moved or resized. You get a nice way of organizing multiple top-level windows. Quite similar with WinAmp 2.x style of sticking the windows
Наследование: System.Windows.Forms.NativeWindow
Пример #1
0
        public MainForm()
        {
            //Initialize the WinForm
            InitializeComponent();

            _stickyWindow = new StickyWindow(this);
        }
        public EnvironmentLightingEditorForm(MainForm parent)
        {
            InitializeComponent();

            _mainForm = parent;

            _stickyWindow = new StickyWindow(this);
        }
Пример #3
0
		public Form2()
		{
			InitializeComponent();
			stickyWindow = new StickyWindow( this );
			checkStickOnMove.Checked	= stickyWindow.StickOnMove;
			checkStickOnResize.Checked	= stickyWindow.StickOnResize;
			checkStickToOthers.Checked	= stickyWindow.StickToOther;
			checkStickToScreen.Checked	= stickyWindow.StickToScreen;
		}
Пример #4
0
 void window_Loaded(object sender, RoutedEventArgs e)
 {
     StickyWindow = new StickyWindow(this);
     StickyWindow.StickToScreen = true;
     StickyWindow.StickToOther = true;
     StickyWindow.StickOnResize = true;
     StickyWindow.StickOnMove = true;
     StickyWindow.MoveStuckTogether = false;
     if (!UiUtils.IsOnScreen(this))
         UiUtils.CenterWindow(this);
 }
Пример #5
0
        /// <summary>
        /// Sets up the form for the current instance.
        /// </summary>
        /// <param name="instanceName">The name of the instance to display.</param>
        public MainForm(string instanceName)
        {
            try
            {
                InitializeComponent();
            }
            catch (COMException loE)
            {
                Logger.Error("Error initializing main view: {0}", loE);
                if ((uint)loE.ErrorCode == 0x80040154)
                {
                    MessageBox.Show(this, Resources.Incorrect_bittedness_of_OotD, Resources.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    throw;
                }
            }

            try
            {
                InstanceName = instanceName;

                // Uniquely identify the previous/next buttons for use in an ugly hack below.
                ButtonNext.Tag = Guid.NewGuid();
                ButtonPrevious.Tag = Guid.NewGuid();

                SuspendLayout();
                LoadSettings();
                ResumeLayout();
                SendWindowToBack();

                // hook up sticky window instance and events to let us know when resizing/moving
                // has ended so we can update the form dimensions in the preferences.
                _stickyWindow = new StickyWindow(this);
                _stickyWindow.MoveEnded += (sender, args) =>
                {
                    SaveFormDimensions();
                };
                _stickyWindow.ResizeEnded += (sender, args) =>
                {
                    SaveFormDimensions();
                };
                    
                // hook up event to keep the date in the header bar up to date
                OutlookViewControl.SelectionChange += OnAxOutlookViewControlOnSelectionChange;
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Error initializing window.");
                MessageBox.Show(this, Resources.ErrorInitializingApp + Environment.NewLine + ex.Message, Resources.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
        }
Пример #6
0
 public SpawnpointEditor(MainForm parent)
 {
     InitializeComponent();
     _mainForm = parent;
     _stickyWindow = new StickyWindow(this);
 }
Пример #7
0
 public ExitEditor(MainForm mainForm)
 {
     InitializeComponent();
     _mainForm = mainForm;
     _stickyWindow = new StickyWindow(this);
 }
Пример #8
0
 /// <summary>
 /// A new StickyWindow is initalised, which says the filter window
 /// should stick to the application main window.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Mask_Options_Loaded(object sender, RoutedEventArgs e)
 {
     stickyWindow = new StickyWindow(this);
     stickyWindow.StickToScreen = false;
     stickyWindow.StickToOther = true;
     stickyWindow.StickOnResize = true;
     stickyWindow.StickOnMove = true;
 }