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

Threaded View

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Exclamation Problem with TabControl

    i create a button in TabControl1 with a name Button1

    when i use

    Button1.BackColor = System.Drawing.Color.MintCream

    it is working fine but when i use (any of the following)

    dim i as integer=1

    Controls(String.Concat("Button", i)).BackColor = System.Drawing.Color.MintCream

    (or)

    Controls(String.Concat("Button"& i)).BackColor = System.Drawing.Color.MintCream

    it gives "An unhandled exception of type 'System.NullReferenceException' occurred in xxxx.exe" error with Additional information: Object reference not set to an instance of an object

    what is the problem i didnt understand :S
    (i am using vb 2005)
    Last edited by matatu; November 25th, 2008 at 06:00 AM. Reason: version of my visual basic compiler

Tags for this Thread

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