当前位置: 首页>>代码示例>>C#>>正文


C# TabPage.Focus方法代码示例

本文整理汇总了C#中System.Windows.Forms.TabPage.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# TabPage.Focus方法的具体用法?C# TabPage.Focus怎么用?C# TabPage.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TabPage的用法示例。


在下文中一共展示了TabPage.Focus方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChatRequestInfo

 private void ����Ի�ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lstVisitors.SelectedItems.Count>0)
     {
         if (IsIP == lstVisitors.SelectedItems[0].SubItems[2].Text)
         {
             DialogResult choice = MessageBox.Show("��������û���������", "�Ƿ��ط�?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
             if (choice == DialogResult.OK)
             {
                 RequestInfo info = this.lstVisitors.SelectedItems[0].Tag as RequestInfo;
                 ChatRequestInfo requestinfo = new ChatRequestInfo();
                 requestinfo.ChatId = Guid.NewGuid().ToString();//chatid
                 requestinfo.AccountId = info.AccoutId.ToString();
                 requestinfo.VisitorIP = lstVisitors.SelectedItems[0].SubItems[2].Text;//IP
                 requestinfo.AcceptByOpereratorId = Program.CurrentOperator.Id; //������Ա
                 requestinfo.RequestDate = DateTime.Now;
                 requestinfo.VisitorName = "";
                 requestinfo.VisitorEmail = "";
                 requestinfo.VisitorUserAgent = lstVisitors.SelectedItems[0].SubItems[4].Text;//�����
                 requestinfo.WasAccept = false;
                 //��Ϣ��ʾ
                 TabPage tab = new TabPage(requestinfo.VisitorIP);
                 LiveChat lc = new LiveChat();
                 lc.Tag = tabChats;
                 lc.ChatRequest = requestinfo;
                 lc.Dock = DockStyle.Fill;
                 tab.Controls.Add(lc);
                 tabChats.TabPages.Add(tab);
                 tab.Focus();
                 TabInfo tabInfo = new TabInfo();
                 tabInfo.ChatId = requestinfo.ChatId;
                 tabInfo.Dock = DockStyle.Fill;
                 if (currentVisitors.ContainsKey(requestinfo.VisitorIP))
                 {
                     tabInfo.RequestEntity = currentVisitors[requestinfo.VisitorIP] as RequestInfo;
                 }
                 //�޸�������Ϣ
                 chatInfo.Add(tabInfo);
                 RefreshTabInfo();
                 IsIP = lstVisitors.SelectedItems[0].SubItems[2].Text;
                 ws.TransferChat(requestinfo);
                 //�޸Ŀͷ����
                 ws.AcceptChatRequest(requestinfo.ChatId, Program.CurrentOperator.Id);//������Ա
             }
         }
         else
         {
             DialogResult choice = MessageBox.Show("�Ƿ�ȷ�Ϸ�������", "YesNo?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (choice == DialogResult.Yes)
             {
                 RequestInfo info = this.lstVisitors.SelectedItems[0].Tag as RequestInfo;
                 ChatRequestInfo requestinfo = new ChatRequestInfo();
                 requestinfo.ChatId = Guid.NewGuid().ToString();//chatid
                 requestinfo.AccountId = info.AccoutId.ToString();
                 requestinfo.VisitorIP = lstVisitors.SelectedItems[0].SubItems[2].Text;//IP
                 requestinfo.AcceptByOpereratorId = Program.CurrentOperator.Id; //������Ա
                 requestinfo.RequestDate = DateTime.Now;
                 requestinfo.VisitorName = "";
                 requestinfo.VisitorEmail = "";
                 requestinfo.VisitorUserAgent = lstVisitors.SelectedItems[0].SubItems[4].Text;//�����
                 requestinfo.WasAccept = false;
                 ws.TransferChat(requestinfo);
                 IsIP = lstVisitors.SelectedItems[0].SubItems[2].Text;
                 //��Ϣ��ʾ
                 TabPage tab = new TabPage(requestinfo.VisitorIP);
                 LiveChat lc = new LiveChat();
                 lc.Tag = tabChats;
                 lc.ChatRequest = requestinfo;
                 lc.Dock = DockStyle.Fill;
                 tab.Controls.Add(lc);
                 tabChats.TabPages.Add(tab);
                 tab.Focus();
                 TabInfo tabInfo = new TabInfo();
                 tabInfo.ChatId = requestinfo.ChatId;
                 tabInfo.Dock = DockStyle.Fill;
                 if (currentVisitors.ContainsKey(requestinfo.VisitorIP))
                 {
                     tabInfo.RequestEntity = currentVisitors[requestinfo.VisitorIP] as RequestInfo;
                 }
                 //�޸�������Ϣ
                 chatInfo.Add(tabInfo);
                 RefreshTabInfo();
             }
         }
     }
     else
     {
         MessageBox.Show("�㻹û��ѡ���˭���жԻ�","��ѡ��",MessageBoxButtons.OK,MessageBoxIcon.Stop);
     }
 }
开发者ID:honj51,项目名称:ideacode,代码行数:90,代码来源:ControlPanel.cs

示例2: btnAccept_Click

        //��������
        private void btnAccept_Click(object sender, EventArgs e)
        {
            if (drpChatRequest.SelectedItem != null)
            {
                //����
                player.Stop();
                //������Ϣ
                ChatRequestInfo req = (ChatRequestInfo)drpChatRequest.SelectedItem;
                drpChatRequest.Items.Remove(req);
                drpChatRequest.Text = string.Empty;

                TabPage tab = new TabPage(req.VisitorIP);
                LiveChat lc = new LiveChat();
                lc.Tag = tabChats;
                lc.ChatRequest = req;
                lc.Dock = DockStyle.Fill;
                tab.Controls.Add(lc);
                tabChats.TabPages.Add(tab);
                tab.Focus();

                TabInfo tabInfo = new TabInfo();
                tabInfo.ChatId = req.ChatId;
                tabInfo.Dock = DockStyle.Fill;
                if (currentVisitors.ContainsKey(req.VisitorIP))
                {
                    tabInfo.RequestEntity = currentVisitors[req.VisitorIP] as RequestInfo;
                }
                //���������Ϣ
                chatInfo.Add(tabInfo);
                RefreshTabInfo();
                //�޸Ŀͷ����
                ws.AcceptChatRequest(req.ChatId,Program.CurrentOperator.Id);//������Ա
            }
        }
开发者ID:honj51,项目名称:ideacode,代码行数:35,代码来源:ControlPanel.cs

示例3: btnInvite_Click

		private void btnInvite_Click(object sender, EventArgs e)
		{
			if (lstVisitors.SelectedIndices.Count > 0)
			{
				List<string> ips = new List<string>();
				foreach(int item in lstVisitors.SelectedIndices)
					ips.Add(lstVisitors.Items[item].SubItems[2].Text);

				if (MessageBox.Show("Are you sure you want to invite " + ips.Count + " visitor(s)?", "LCSK", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
				{
					foreach (string ip in ips)
					{
						ChatRequest req = ws.Invite(new Guid(Program.CurrentOperator.Password), Program.CurrentOperator.OperatorId, ip, "");
						
						// Add a new tab page that will contain the chat session
						TabPage tab = new TabPage(req.VisitorIp);
						LiveChat lc = new LiveChat();
						lc.ChatRequest = req;
						lc.Dock = DockStyle.Fill;
						tab.Controls.Add(lc);
						tabChats.TabPages.Add(tab);
						tab.Focus();

						// Add a new TabInfo control
						TabInfo tabInfo = new TabInfo();
						tabInfo.ChatId = req.ChatId;
						tabInfo.ChatRequest = req;
						tabInfo.MyTab = tab;
						tabInfo.Dock = DockStyle.Fill;

						// Get the request
						if (currentVisitors.ContainsKey(req.VisitorIp))
						{
							tabInfo.RequestEntity = currentVisitors[req.VisitorIp] as WebRequest;
						}

						chatInfo.Add(tabInfo);
						RefreshTabInfo();
					}

					
				}
			}
		}
开发者ID:DrZhong,项目名称:ChatOnlin,代码行数:44,代码来源:ControlPanel.cs

示例4: btnAccept_Click

        private void btnAccept_Click(object sender, EventArgs e)
        {
            // Accept a new chat request
            if (drpChatRequest.SelectedItem != null)
            {
                player.Stop();


                ChatRequest req = (ChatRequest)drpChatRequest.SelectedItem;

                // Remove the chat request from the combo
                drpChatRequest.Items.Remove(req);
                drpChatRequest.Text = string.Empty;

				// Accept the chat request
				ws.AcceptRequest(new Guid(Program.CurrentOperator.Password), req.ChatId, Program.CurrentOperator.OperatorId);

                // Add a new tab page that will contain the chat session
                TabPage tab = new TabPage(req.VisitorIp);
                LiveChat lc = new LiveChat();
                lc.ChatRequest = req;
                lc.Dock = DockStyle.Fill;
                tab.Controls.Add(lc);
                tabChats.TabPages.Add(tab);
                tab.Focus();

                // Add a new TabInfo control
                TabInfo tabInfo = new TabInfo();
                tabInfo.ChatId = req.ChatId;
				tabInfo.ChatRequest = req;
				tabInfo.MyTab = tab;
                tabInfo.Dock = DockStyle.Fill;



                // Get the request
                if (currentVisitors.ContainsKey(req.VisitorIp))
                {
                    tabInfo.RequestEntity = currentVisitors[req.VisitorIp] as WebRequest;
                }


                chatInfo.Add(tabInfo);
                RefreshTabInfo();
            }
        }
开发者ID:DrZhong,项目名称:ChatOnlin,代码行数:46,代码来源:ControlPanel.cs

示例5: _addTab

 private void _addTab(UserControl ctrl, string title)
 {
     TabPage page = new TabPage(title);
     page.Controls.Add(ctrl);
     tabMainTabControl.TabPages.Add(page);
     page.Focus();
 }
开发者ID:usmanghani,项目名称:Misc,代码行数:7,代码来源:MainForm.cs

示例6: _activityControlsController_OnExpandCompositeActivity

 void _activityControlsController_OnExpandCompositeActivity(BaseActivity activity){
     var tabPage = new TabPage(activity.Name);
     tabControl.TabPages.Add(tabPage);
     tabPage.Focus();
 }
开发者ID:satr,项目名称:rvslite,代码行数:5,代码来源:MainForm.cs

示例7: Preprocess

        /*
        protected void Preprocess (string sSearchString)
        {
            int i_Stress = Convert.ToInt32(true); // It should've been bool
            if (Regex.IsMatch (sSearchString, (string)">"))
            {
                i_Stress = Convert.ToInt32(true);
            }
            else
            {
                i_Stress = Convert.ToInt32(true); // Test
            }
            sSearchString = sSearchString.Replace(">", "");
            if (Regex.IsMatch (sSearchString, (string)"\\-"))
            {
                string[] arr_Range = Regex.Split (sSearchString, (string)"([0-9]*)\\-([0-9]*)");
                long l_start_id = long.Parse(arr_Range[1]);
                long l_end_id = long.Parse(arr_Range[2]);
                m_LexPreprocessor.PrepareLexemes (l_start_id, l_end_id, i_Stress);
            }
            else
            {
                long l_lexeme_id = long.Parse (sSearchString);
                m_LexPreprocessor.PrepareLexeme(l_lexeme_id, i_Stress);
            }

        }   //  Preprocess (...)
        */
        protected void ShowParseOutput()
        {
            int iWordform = 0, iPreviousID = -1;
            tabControl.TabPages.Clear();

            if (null == m_Parser)
            {
                MessageBox.Show("Internal error: Parser object is null.", "Zal error", MessageBoxButtons.OK);
                return;
            }

            int iWordForm = 0;
            CWordFormManaged wordform = null;
            EM_ReturnCode eRet = (EM_ReturnCode)m_Parser.eGetFirstWordForm(ref wordform);
            if (CErrorCode.bError(eRet))
            {
                MessageBox.Show("Error");
                return;
            }
            if(EM_ReturnCode.H_NO_ERROR != eRet)
            {
                MessageBox.Show("Form not found");
                return;
            }

            do
            {
                m_listWordForms.Add(wordform);
                AnalysisPanel ap = new AnalysisPanel(iWordform);
            //                ap.Location = new System.Drawing.Point(0, iWordform * ap.Size.Height + 4);
                string sWordForm = wordform.sWordForm();
                MarkStress(ref sWordForm, wordform);
                ap.sWordform = sWordForm;
                ap.sID = wordform.llLexemeId().ToString();
                ap.eoPOS = wordform.ePos();
                ap.eoAspect = wordform.eAspect();
                ap.eoGender = wordform.eGender();
                ap.eoCase = wordform.eCase();
                ap.eoNumber = wordform.eNumber();
                ap.eoAnimacy = wordform.eAnimacy();
                ap.eoPerson = wordform.ePerson();
                ap.eoReflexiveness = wordform.eReflexive();
                ap.eoSubparadigm = wordform.eSubparadigm();
                iWordform = 0;
                iPreviousID = (int)wordform.llLexemeId();
                TabPage tab_Lexeme = new TabPage(wordform.sWordForm());
            //                tab_Lexeme.Text = wordform.sWordForm();
                tab_Lexeme.AutoScroll = true;
                tab_Lexeme.Controls.Add(ap);
                tabControl.TabPages.Add(tab_Lexeme);
                tab_Lexeme.Show();
                tab_Lexeme.Focus();
                ++iWordform;
                ap.Show();

                eRet = (EM_ReturnCode)m_Parser.eGetNextWordForm(ref wordform);

            } while (EM_ReturnCode.H_NO_ERROR == eRet);
        }
开发者ID:kbogatyrev,项目名称:Zal-Windows,代码行数:87,代码来源:ZalTestLogic.cs


注:本文中的System.Windows.Forms.TabPage.Focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。