Results 1 to 4 of 4

Thread: creating new controls...

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    32

    creating new controls...

    Hi, I was wondering how to make a new (lets say) text box in VB 2005...I've been working at it ofr a few days and I can't seem to figure it out

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: creating new controls...

    Do you want to dynamically create a textbox, or inherit the textbox and add your own functionality?

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    32

    Re: creating new controls...

    better example I guess: to make a new web browser than I could control with like back and forward etc. buttons.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: creating new controls...

    Your question is unclear. Do you mean that you want to know how to create a Web browser application, or how to create a WebBrowser control and add it to your form at run time, or something else? If you mean creating controls at run time then you simply create a new instance of the control, set the appropriate properties like Size and Location, then add it to the Controls collection of the form or container that will hold it. The code is exactly the same as that created by the form designer when you add controls at design time, so you can inspect that code for an example. Go to the Solution Explorer, click the Show All Files button, then open the .designer.vb file for the form to see the autogenerated code. Be careful NOT to change it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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