Results 1 to 6 of 6

Thread: Add Properties to PictureBox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fox, OK
    Posts
    381

    Add Properties to PictureBox

    Can I create a new class that inherits the PictureBox and add two new properties to it and then access those properties in my code?

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Add Properties to PictureBox

    Yes you can.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fox, OK
    Posts
    381

    Re: Add Properties to PictureBox

    Then I assume I would have to add them to my form in code - rather than from the toolbox. But I'm not sure how.

  4. #4
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Add Properties to PictureBox

    You can add it to your form from the toolbox, when you build the app your user control will be at the very top with a purple icon, just drag it to your form and it creates one for you like any other form control.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Add Properties to PictureBox

    Thread moved from the 'CodeBank VB.Net' forum (which is for you to post working code examples, not questions) to the 'VB.Net' forum

    (thanks for letting us know folks )

  6. #6
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: Add Properties to PictureBox

    you can either set the autotoolboxpopulate to true in Tools -> options
    in windows form designer
    now your new picturebox class should be in your toolbox.

    or do it manually
    place a picturebox on your form
    select the form and be sure the show all files in the solution explorer is active...
    Open the designer file and alter the
    Me.PictureBox1 = New System.Windows.Forms.PictureBox
    and
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox

    into creating your class
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another 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