當前位置: 首頁>>代碼示例>>C#>>正文


C# TreeView.Refresh方法代碼示例

本文整理匯總了C#中System.Windows.Forms.TreeView.Refresh方法的典型用法代碼示例。如果您正苦於以下問題:C# TreeView.Refresh方法的具體用法?C# TreeView.Refresh怎麽用?C# TreeView.Refresh使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.TreeView的用法示例。


在下文中一共展示了TreeView.Refresh方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddURLToTreeView

		public static void AddURLToTreeView(string url, Mode mode, TreeView treeView, Hashtable htNodes)	{
			Regex r							= new Regex(@"^\s*(?<protocol>https?)://(?<path>.*)", RegexOptions.IgnoreCase);
			Match m							= r.Match(url);
			TreeNodeCollection nodes		= treeView.Nodes;
			if ( m.Success )	{
				Protocol p	= (Protocol)Enum.Parse(typeof(Protocol), m.Result("${protocol}"), true);
				char[] separators			= { '\\', '/' };
				ExtendedTreeNode etn		= null;
				foreach ( string path in m.Result("${path}").Split(separators) )	{
					if ( htNodes.ContainsKey(path) )	{
						etn					= (ExtendedTreeNode)htNodes[path];
					}
					else	{
						etn					= new ExtendedTreeNode(path);
						etn.ForeColor		= getColourCode(mode, p);
						nodes.Add(etn);
						htNodes.Add(path, etn);
					}
					// Expand the node in mode two
					if ( mode == Mode.two )
						etn.Expand();
					htNodes					= etn.children;
					nodes					= etn.Nodes;
				}		// next node
				etn.ForeColor				= getColourCode(mode, p);
				treeView.Refresh();
			}		// if valid url
		}		// end AddURLToTreeView()
開發者ID:QardenEden,項目名稱:Suru,代碼行數:28,代碼來源:ExtendedTreeNode.cs

示例2: DisplayTo

 public static void DisplayTo( TreeView tree )
 {
     tree.BeginUpdate();
     tree.Nodes.Clear();
     Recurse( tree.Nodes, Config.GetUserDirectory( "Macros" ) );
     tree.EndUpdate();
     tree.Refresh();
     tree.Update();
 }
開發者ID:herculesjr,項目名稱:razor,代碼行數:9,代碼來源:MacroManager.cs

示例3: ReadTreeNode

 //畫樹形圖,
 private static void ReadTreeNode(TreeView xTree)
 {
     TreeNode tnRet = null;
     xTree.Nodes.Clear();
     string xSql = "SELECT * FROM MenuView WHERE LimitID='1'";
     SqlDataReader xRec = Program.SqlReader(xSql);
     if (xRec != null)
     {
         if (xRec.HasRows == false)
         {
             xTree.Refresh();
         }
         else
         {
             while (xRec.Read())
             {
                 TreeNode tn = new TreeNode(xRec["Nam"].ToString());
                 tn.Name = xRec["Code"].ToString();
                 if (xRec["CanRun"].ToString() == "1")
                 {
                     tn.Checked = true;
                 }
                 else
                 {
                     tn.Checked = false;
                 }
                 if (xRec["Parent"].ToString() == "000")
                 {
                     xTree.Nodes.Add(tn);
                 }
                 else
                 {
                     if (xRec["Parent"].ToString() != null)
                     {
                         foreach (TreeNode xtn in xTree.Nodes)
                         {
                             tnRet = FindNode(xtn, xRec["Parent"].ToString());
                             if (tnRet != null) break;
                         }
                         if (tnRet != null)
                         {
                             tnRet.Nodes.Add(tn);
                             tnRet.Expand();
                         }
                     }
                 }
             }
         }
         xRec.Close();
     }
 }
開發者ID:TJWHProject,項目名稱:LiebaoCMBManage,代碼行數:52,代碼來源:SetOp.cs

示例4: fillTreeViewCategorias

        public static void fillTreeViewCategorias(TreeView dataCategorias, List<Categoria> result)
        {
            dataCategorias.Nodes.Clear();    // Clear any existing items
            dataCategorias.BeginUpdate();    // prevent overhead and flicker

            TreeNode root = dataCategorias.Nodes.Add( "---" );
            root.Tag = new Categoria(0);
            root.Expand();
            Dictionary<short, TreeNode> nodes = new Dictionary<short, TreeNode>();

            //asume fathers first
            foreach (Categoria cat in result) {
                TreeNode node = (cat.categoria_padre == null ? root: nodes[(short)cat.categoria_padre]).Nodes.Add(cat.nombre);
                node.Tag = cat;
                nodes.Add(cat.id, node);
            }

            dataCategorias.EndUpdate();
            dataCategorias.Refresh();
        }
開發者ID:sebasjm,項目名稱:gestion1c2011,代碼行數:20,代碼來源:ViewHelper.cs

示例5: loadNotifications

        private int loadNotifications(TreeView tv)
        {
            int iCnt = 0;
            tv.Nodes.Clear();
            TreeNode tnMain = tv.Nodes.Add("Notifications");

            int[] iHandles = OpenNETCF.WindowsCE.Notification.Notify.GetUserNotificationHandles();
            _sList = new List<string>();
            _sList.Clear();

            _strArr = new string[iHandles.Length + 1][];

            _strArr[0] = new string[7] { "App", "Args", "Event", "Start", "End", "Type", "handle" };

            int i = 0;

            eventEntries = new EventEntry[iHandles.Length];

            foreach (int iHandle in iHandles)
            {
                OpenNETCF.WindowsCE.Notification.UserNotificationInfoHeader infoHeader = OpenNETCF.WindowsCE.Notification.Notify.GetUserNotification(iHandle);
                string[] strArray = new string[] { infoHeader.UserNotificationTrigger.Application, infoHeader.UserNotificationTrigger.Arguments };
                TreeNode tn = new TreeNode(infoHeader.UserNotificationTrigger.Application);
                tnMain.Nodes.Add(tn);
                tn.Nodes.Add("Args: " + infoHeader.UserNotificationTrigger.Arguments);
                tn.Nodes.Add("Event: " + infoHeader.UserNotificationTrigger.Event.ToString());
                tn.Nodes.Add("Start: " + infoHeader.UserNotificationTrigger.StartTime.ToString("dd.MM.yyyy HH:mm"));
                tn.Nodes.Add("End: " + infoHeader.UserNotificationTrigger.EndTime.ToString("dd.MM.yyyy HH:mm"));
                tn.Nodes.Add("Type: " + infoHeader.UserNotificationTrigger.Type.ToString());
                tn.Nodes.Add("Handle: " + iHandles[i].ToString());

                //eventEntries[i].sApp = infoHeader.UserNotificationTrigger.Application;
                //eventEntries[i].sEvent = infoHeader.UserNotificationTrigger.Event.ToString();
                //eventEntries[i].sArg = infoHeader.UserNotificationTrigger.Arguments;
                //eventEntries[i].sStartTime = infoHeader.UserNotificationTrigger.StartTime.ToString("dd.MM.yyyy HH:mm");
                //eventEntries[i].sEndTime = infoHeader.UserNotificationTrigger.EndTime.ToString("dd.MM.yyyy HH:mm");
                //eventEntries[i].sType = infoHeader.UserNotificationTrigger.Type.ToString();
                //eventEntries[i].sHandle = iHandles[i].ToString();

                iCnt++;
            }
            tv.Refresh();
            return iCnt;
        }
開發者ID:andrejpanic,項目名稱:win-mobile-code,代碼行數:44,代碼來源:CeUserNotificationsClass.cs

示例6: Write_Tree

        public void Write_Tree(TreeView Tree_View, DateTime Date)
        {
            foreach (Event e in file.All_Events)
            {
                if (Date > e.Completed && e.Done)
                {

                }
                else
                {
                    TreeNode nod = new TreeNode();
                    if (e.Done == true)
                    {
                        nod.BackColor = Color.LightGray;
                    }
                    else if (e.Due_Date)
                    {
                        nod.BackColor = Color.LightCoral;
                    }
                    else if (e.Completion != 0)
                    {
                        nod.BackColor = Color.LightBlue;
                    }
                    else
                    {
                        nod.BackColor = Color.LightGreen;
                    }

                    nod.Tag = nod.BackColor;
                    nod.Text = e.Title;
                    nod.Name = "trn_" + e.Title;
                    Tree_View.Nodes.Add(nod);
                    Tree_View.SelectedNode = nod;
                    Write_Node(Tree_View, e, Date);
                }
            }
            Tree_View.ExpandAll();
            Tree_View.Refresh();
            Tree_View.SelectedNode = null;
        }
開發者ID:MarshallPelissier,項目名稱:To-Do,代碼行數:40,代碼來源:BaseForm.cs

示例7: ReadTreeNodeNoCheck

 private void ReadTreeNodeNoCheck(TreeView xTree, string xSql)
 {
     TreeNode tnRet = null;
     xTree.Nodes.Clear();
     SqlDataReader xRec = Program.SqlReader(xSql);
     if (xRec != null)
     {
         if (xRec.HasRows == false)
         {
             xTree.Refresh();
         }
         else
         {
             while (xRec.Read())
             {
                 TreeNode tn = new TreeNode(xRec["Nam"].ToString());
                 tn.Name = xRec["Code"].ToString();
                 if (xRec["CanRun"].ToString() == "1")
                 {
                     if (xRec["Parent"].ToString() == "000")
                     {
                         xTree.Nodes.Add(tn);
                     }
                     else
                     {
                         if (xRec["Parent"].ToString() != null)
                         {
                             foreach (TreeNode xtn in xTree.Nodes)
                             {
                                 tnRet = FindNode(xtn, xRec["Parent"].ToString());
                                 if (tnRet != null) break;
                             }
                             if (tnRet != null)
                             {
                                 tnRet.Nodes.Add(tn);
                                 tnRet.Expand();
                             }
                         }
                     }
                 }
             }
         }
         xRec.Close();
     }
 }
開發者ID:TJWHProject,項目名稱:LiebaoCMBManage,代碼行數:45,代碼來源:SetOp.cs


注:本文中的System.Windows.Forms.TreeView.Refresh方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。