Yes, you should have been more specific. You should always give the full story from the start.
Any time you get a NullReferenceException, the first thing to do is to establish which reference is null. In your case you need to determine whether this:is Nothing or this:vb.net Code:
Form1.TabControl1.TabPages(GetPageName)is Nothing. If you don't actually know what problem you're trying to solve then it can make it difficult to solve it.vb.net Code:
Form1.TabControl1.TabPages(GetPageName).controls(GetQName)
On an unrelated note, you're doing something there which, while legal, is very poor practice. NEVER, EVER declare anything without a type. What are these supposed to be:If they're supposed to be Integers then declare tham as such. Otherwise they're both type Object regardless of what you assign to them. You obviously have Option Strict Off, which I suggest you set to On immediately. Option Strict On would not allow you to do things like declare variables without types.Code:Dim NewTop Dim QTop




Reply With Quote