Exemple #1
0
        private void ToolStripStatusLabel1_Click(object sender, EventArgs e)
        {
            ToolStripLabel myHyperLinkLabel = sender as ToolStripLabel;

            try
            {
                Process.Start(new ProcessStartInfo(myHyperLinkLabel.ToString()));
            }
            catch (Exception ex)
            {
                MessageBox.Show("A problem occurred" + ex.Message);
            }
        }
Exemple #2
0
        public void Accessibility()
        {
            ToolStripLabel   tsi = new ToolStripLabel();
            AccessibleObject ao  = tsi.AccessibilityObject;

            Assert.AreEqual("ToolStripItemAccessibleObject: Owner = " + tsi.ToString(), ao.ToString(), "L");
            Assert.AreEqual(Rectangle.Empty, ao.Bounds, "L1");
            Assert.AreEqual(string.Empty, ao.DefaultAction, "L2");
            Assert.AreEqual(null, ao.Description, "L3");
            Assert.AreEqual(null, ao.Help, "L4");
            Assert.AreEqual(string.Empty, ao.KeyboardShortcut, "L5");
            Assert.AreEqual(string.Empty, ao.Name, "L6");
            Assert.AreEqual(null, ao.Parent, "L7");
            Assert.AreEqual(AccessibleRole.StaticText, ao.Role, "L8");
            Assert.AreEqual(AccessibleStates.ReadOnly, ao.State, "L9");
            Assert.AreEqual(string.Empty, ao.Value, "L10");

            tsi.Name = "Label1";
            tsi.Text = "Test Label";
            tsi.AccessibleDescription = "Label Desc";

            Assert.AreEqual(Rectangle.Empty, ao.Bounds, "L11");
            Assert.AreEqual(string.Empty, ao.DefaultAction, "L12");
            Assert.AreEqual("Label Desc", ao.Description, "L13");
            Assert.AreEqual(null, ao.Help, "L14");
            Assert.AreEqual(string.Empty, ao.KeyboardShortcut, "L15");
            Assert.AreEqual("Test Label", ao.Name, "L16");
            Assert.AreEqual(null, ao.Parent, "L17");
            Assert.AreEqual(AccessibleRole.StaticText, ao.Role, "L18");
            Assert.AreEqual(AccessibleStates.ReadOnly, ao.State, "L19");
            Assert.AreEqual(string.Empty, ao.Value, "L20");

            tsi.AccessibleName = "Access Label";
            Assert.AreEqual("Access Label", ao.Name, "L21");

            tsi.Text = "Test Label";
            Assert.AreEqual("Access Label", ao.Name, "L22");

            tsi.AccessibleDefaultActionDescription = "AAA";
            Assert.AreEqual("AAA", tsi.AccessibleDefaultActionDescription, "L23");
        }