Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Adding controls during runtime problem

Last post 03-25-2008 1:25 PM by Jugatsu. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-19-2008 8:10 PM

    • m1dnight
    • Not Ranked
    • Joined on 03-15-2006
    • Belgium
    • New Member
    • Points 10

    Adding controls during runtime problem

     Hello guys, i'm new to this forum so hi.

    I'm here with my first problem. I'm in my last year of high school, and I need to create a program for a pay-desk.

    now, i was planning on adding controls depending on the user that logs in.

    so i was writing a procedure to add the controls for eg the manager.

    And i tried the following:

    Dim lstTables as new listbox

    me.controls.add(lstTables)

    it still works at this point, but it goes wrong with the following:

    lstTables.Location.X(10)

    the error message says: property acces must assign to the property or use it's value.

     

    How can i change the size, location etc? Ive tried everything i know about controls, it should work i think because isnt it the same as 'button.text = "" ' ?

     

    Grtz, m1dnight 

    • Post Points: 10
  • 03-25-2008 1:25 PM In reply to

    • Jugatsu
    • Not Ranked
    • Joined on 02-15-2006
    • Member
    • Points 275

    Re: Adding controls during runtime problem

    Try

    Dim lstTables as new listbox()
    lstTables.Location = New Point(10,10)
    me.Controls.Add(lstTables)

     

    A simpler way for your project might be, to add all the controls and hide the controls from the user that logs in.

     

    • Post Points: 5
Page 1 of 1 (2 items)