CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #2
    Join Date
    Nov 2009
    Location
    .net 3.5 csharp 2008 developer
    Posts
    36

    Re: How to change button color using tag or name property

    ---EDIT----
    You never assign anything to your .Tag property :P


    I cant see why it wouldn't work except that in your web application you are looking for controls in panel1, whilst in your forms app you refer to this.Controls. Is "this" refering to the form or panel1 ?

    I did a simple test
    Code:
            private void button1_Click(object sender, EventArgs e)
            {
                button1.BackColor = Color.Yellow;
            }
    That changes the color of the button without any problems. Can you place a breakpoint in your code where it is supposed to change the color and see that it is actually being executed?
    Last edited by ixilom; November 15th, 2009 at 12:24 PM. Reason: Noticed something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured