protected void res_Resized(object sender, ResizeHandler.ResizedEventArgs e) { // Calculating width/height - "extras"... int width = Math.Max(e.Width - 20, 500); int height = Math.Max(e.Height - 20, 400); // Creating effects to animate window... new EffectSize(wndTop, 200, -1, width) .ChainThese( new EffectSize(pnlLeft, 200, height - 150, -1), new EffectSize(pnlMid, 200, height - 150, -1), new EffectSize(pnlRight, 200, height - 150, -1), new EffectMove(wndRight, 200, width - 210, int.Parse(wndRight.Style[Styles.top].Replace("px", ""))), new EffectSize(wndMid, 200, -1, width - 430) ) .Render(); // Setting top window size wndTop.Style["width"] = string.Format("{0}px", width); // Setting left window size pnlLeft.Style["height"] = string.Format("{0}px", height - 150); // Setting center window size pnlMid.Style["height"] = string.Format("{0}px", height - 150); wndMid.Style["width"] = string.Format("{0}px", width - 430 /* 215x2 width of left and right combined */); // Setting right window position pnlRight.Style["height"] = string.Format("{0}px", height - 150); wndRight.Style["left"] = string.Format("{0}px", width - 210); }
public Form1() { InitializeComponent(); // create day selection buttons for day view rightDayButton = new Button(); leftDayButton = new Button(); rightDayButton.Height = 36; rightDayButton.Width = 80; rightDayButton.Margin = new Padding(0); rightDayButton.Text = "Next"; rightDayButton.Font = new Font("Microsoft Sans Serif", 10); rightDayButton.FlatStyle = FlatStyle.Flat; rightDayButton.BackColor = SystemColors.ControlLightLight; rightDayButton.FlatAppearance.BorderColor = SystemColors.ControlDark; rightDayButton.FlatAppearance.MouseDownBackColor = Color.FromArgb(153, 98, 107); rightDayButton.FlatAppearance.MouseOverBackColor = Color.FromArgb(205, 169, 169); rightDayButton.Visible = false; rightDayButton.Location = new Point(0, 0); leftDayButton.Height = 36; leftDayButton.Width = 80; leftDayButton.Margin = new Padding(0); leftDayButton.Text = "Previous"; leftDayButton.Font = new Font("Microsoft Sans Serif", 10); leftDayButton.FlatStyle = FlatStyle.Flat; leftDayButton.BackColor = SystemColors.ControlLightLight; leftDayButton.FlatAppearance.BorderColor = SystemColors.ControlDark; leftDayButton.FlatAppearance.MouseDownBackColor = Color.FromArgb(153, 98, 107); leftDayButton.FlatAppearance.MouseOverBackColor = Color.FromArgb(205, 169, 169); leftDayButton.Visible = false; leftDayButton.Location = new Point(0, 0); Controls.Add(leftDayButton); Controls.Add(rightDayButton); dayLabels = new Label[] { mondayLabel, tuesdayLabel, wednesdayLabel, thursdayLabel, fridayLabel }; selectedDayLabel = dayLabels[0]; // hide day labels until they are fully loaded dayLabelPanel.Hide(); // configure and add day change buttons to the dayLabelPanel for easier positioning leftDayButton.Top = selectedDayLabel.Top; leftDayButton.Click += new EventHandler(LeftDayButton_Click); dayLabelPanel.Controls.Add(leftDayButton); rightDayButton.Top = selectedDayLabel.Top; rightDayButton.Click += new EventHandler(RightDayButton_Click); dayLabelPanel.Controls.Add(rightDayButton); // set PopulateCalendars as the handler of the RefreshCalendarsEvent RefreshCalendars.RefreshCalendarsEvent += new Action(PopulateCalendars); // set ResizeDayLabels as the handler of the ResizeHandler of both calendar views ResizeHandler handler = new ResizeHandler(ResizeDayLabels); calendarWeekView1.ResizeEvent += handler; calendarDayView1.resizeEvent += handler; }
private void EnsureNoResizeHandler() { if (_ResizeHandler) { DestroyImmediate(_ResizeHandler); } _ResizeHandler = null; }
private void EnsureResizeHandler() { if (!_ResizeHandler) { _ResizeHandler = _Target.GetComponent <ResizeHandler>(); if (!_ResizeHandler) { _ResizeHandler = _Target.gameObject.AddComponent <ResizeHandler>(); } } }
async void InitializeSplitGutter() { await JSRunTime.InvokeVoidAsync("splitterLib.createSplit", ".gutter-col-1"); await ResizeHandler.InitializeHandler(); }
protected void re_Resized(object sender, ResizeHandler.ResizedEventArgs e) { lbl.Text = string.Format("New size width {0}px and height {1}px", e.Width, e.Height); new EffectHighlight(lbl, 400).Render(); System.Threading.Thread.Sleep(1000); }