// fired whenever a move over a drop destination is detected private void Cb_DragOver(object sender, DragEventArgs e) { var dropDest = sender as CheckBox; if (!e.Data.GetDataPresent(typeof(CheckBox))) { e.Effect = DragDropEffects.None; // source is not a checkbox return; } if (!IsSamePanel(dragSourceKey, dropDest.Name)) { e.Effect = DragDropEffects.None; // attempt to drop to other panel return; } // Finally a valid drop zone.. dragDropKey = dropDest.Name; e.Effect = DragDropEffects.Move; // scroll outside items into view var srcIdx = m_flp.Controls.GetChildIndex(m_flp.Controls[dragSourceKey]); var dstIdx = m_flp.Controls.GetChildIndex(dropDest); if ((dstIdx < srcIdx) && (dstIdx > 0)) { // going up and not topmost m_flp.ScrollControlIntoView(m_flp.Controls[dstIdx - 1]); } else if ((dstIdx > srcIdx) && (dstIdx < (m_flp.Controls.Count - 1))) { // going down and not last m_flp.ScrollControlIntoView(m_flp.Controls[dstIdx + 1]); } }
void AddSubsUiItem(Models.Datas.SubscriptionItem data) { var subsUi = new Views.UserControls.SubscriptionUI(this, data); flyPanel.Controls.Add(subsUi); flyPanel.ScrollControlIntoView(subsUi); }
void AddSubsUiItem(Models.Datas.SubscriptionItem data) { var subsUi = new Views.UserControls.SubscriptionUI(this, data); flyPanel.Controls.Add(subsUi); flyPanel.ScrollControlIntoView(subsUi); UpdateServUiTotal(this, EventArgs.Empty); }
public void AddPeerText(string word, bool IsFile = false)//显示对方发送信息 { Bitmap Portrait = Tag.GetPortrait(); SendBox NewSend = new SendBox(word, 0, Portrait, this.Name); if (IsFile) { NewSend.IsFile = true; } ChatPanel.Controls.Add(NewSend); ChatPanel.ScrollControlIntoView(NewSend); Tag.SetTime(NewSend.GetTime()); Tag.SetWords(NewSend.GetWords()); string temp = "[" + NewSend.GetTime() + "]" + this.Name + ":" + word; this.WordList.Add(temp); }
private void positionSwitch1_DownButton(object sender, EventArgs e) { //reorder rack Control item = (Control)plugin.corruptor.GetUserControl(); int i = rack.Controls.IndexOf(item); if (i < rack.Controls.Count - 1) { rack.Controls.SetChildIndex(item, i + 2); i = rack.Controls.IndexOf(this); rack.Controls.SetChildIndex(this, i + 2); rack.ScrollControlIntoView(item); } //raise re-order event for chain if (MovePluginDown != null) { MovePluginDown(this, new PluginMoveEventArgs(plugin)); } }
public JA_AdminQuestionReply() { InitializeComponent(); var q = Cls_JA_Member.db.Questions.Where(n => !n.IsRead).GroupBy(n => n.UserID) .Select(n => new { UserId = n.Key, Count = n.Count(), Order = n.GroupBy(nn => nn.OrderHeader.OrderNum).Select(nn => new { OrderNum = nn.Key, 留言內容 = nn }) }); //這邊做左邊導覽列 foreach (var item in q) { JA_AdminReplayLeft jA_AdminReplayLeft = new JA_AdminReplayLeft { _Pname = Cls_JA_Member.db.Users.Find(item.UserId).UserName, _Count = item.Count.ToString(), }; jA_AdminReplayLeft.點擊 += () => { this.tabControl1.Controls.Clear(); foreach (var item2 in item.Order) { TabPage tp = new TabPage(item2.OrderNum.ToString()); tp.BorderStyle = BorderStyle.Fixed3D; this.tabControl1.TabPages.Add(tp); FlowLayoutPanel flow = new FlowLayoutPanel(); flow.Dock = DockStyle.Fill; flow.AutoScroll = true; tp.Controls.Add(flow); foreach (var item3 in item2.留言內容) { JA_QuestionList list = new JA_QuestionList { 問題 = item3.Question1, 回答 = item3.Answer, 創建時間 = item3.CreateDate, Tag = item3.QuestionID, }; flow.Controls.Add(list); flow.ScrollControlIntoView(list); Application.DoEvents(); } } }; flowLayoutPanel1.Controls.Add(jA_AdminReplayLeft); } }
void BindEventBtnAddClick() { this.btnAdd.Click += (s, a) => { var control = new Views.UserControls.MultiConfUI( new Models.Datas.MultiConfItem(), UpdatePanelItemsIndex); flyPanel.Controls.Add(control); flyPanel.ScrollControlIntoView(control); UpdatePanelItemsIndex(); }; }
public TextBox add(string msg, MouseEventHandler mousedown, MouseEventHandler mousedoubleclick) { if (fp.InvokeRequired) { return((TextBox)fp.Invoke(new tb_invoker(() => add(msg, mousedown, mousedoubleclick)))); } if (file != null) { file.WriteLine(DateTime.Now.ToString() + ": " + msg); file.Flush(); } if (list.Count >= maxcount) { del((TextBox)list[0]); } TextBox tb = new TextBox(); tb.ReadOnly = true; tb.BackColor = fp.BackColor; tb.BorderStyle = BorderStyle.None; tb.ForeColor = Color.White; tb.Width = width; tb.Text = msg; if (mousedown != null) { tb.MouseDown += mousedown; } if (mousedoubleclick != null) { tb.MouseDoubleClick += mousedoubleclick; } fp.Controls.Add(tb); fp.ScrollControlIntoView(tb); list.Add(tb); return(tb); }
/// <summary> /// Ensure a specific thumbnail entry is visible (i.e. scroll so it is). /// </summary> /// <param name="thumb">Entry to scroll to, must be contained in the thumbnail view</param> public void EnsureVisible(TThumbnailType thumb) { Debug.Assert(Entries.Contains(thumb)); Flow.ScrollControlIntoView(thumb); }