Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Forms and Labels

$
0
0

Hello

I have a Windows Form where I click a button to populate some listview and treeview, I have added a label which as default shows disconnected.

Within the code to populate I have added some code to change the label to connecting and connected, however when I click the button it does not display connecting only when the treeview is populated does it display connected. There are many files this is why I have introduced this type of status messages to prevent the user from clicking al the time.

The code;

private void PopulateTreeView()
        {
            labStatusIm.Text = "Connecting";

            TreeNode rootNode;

            DirectoryInfo info = new DirectoryInfo(@"X:\Drawings");
            if (info.Exists)
            {
                rootNode = new TreeNode(info.Name);
                rootNode.Tag = info;
                GetDirectories(info.GetDirectories(), rootNode);
                treeView1.Nodes.Add(rootNode);
            }

            labStatusIm.Text = "Connected";
        }

Why is it not displaying connecting?

Many Thanks


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>