Results 1 to 4 of 4

Thread: Custom control as a class? *(Resolved)*

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Thumbs up Custom control as a class? *(Resolved)*

    First I would like to again thank kleinma for assisting me with the below code.
    What I would like to do now is well convert this somehow to a class. so I do not have to DirectCast the items. Is this possible?

    Here is the original code that kleinma assisted me with:

    Dim CtlLosArray(150) As ShieldLOSInfobox

    CtlLosArray(0) = New ShieldLOSInfobox
    CtlLosArray(0).Location = New Point(0, 0)
    CtlLosArray(0).Visible = True
    CtlLosArray(0).Show()
    CtlLosArray(0).Name = "Label1"
    Me.pnlLOS.Controls.Add(CtlLosArray(0))

    DirectCast(Me.pnlLOS.Controls("Label1"), ShieldLOSInfobox).Textbox1.Text = "HELLO WORLD"

    Now with this line right here:

    DirectCast(Me.pnlLOS.Controls("Label1"), ShieldLOSInfobox).Textbox1.Text = "HELLO WORLD"


    I would like to do something like this instead

    CtlLosArray(1).Textbox1.text = "Hello World"

    Is there a way to make this into a custom class so that I can make things easier to manipulate? at least that is how I think it would be done.

    I appreciate everyone assistance.

    Mythos
    Last edited by Mythos44; Nov 9th, 2009 at 02:09 PM. Reason: *Resolved*

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