Results 1 to 2 of 2

Thread: Usercontrols....

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Usercontrols....

    in my usercontrol I have a PictureBox property. I want it to list all the pictureboxes that are available on the form... for example when you have a Notify Icon, there is a ContextMenu property in the properties window. When you click on it, it will list all the context menus on the form
    I want to do the same thing, but I want my usercontrol to list the pictureboxes on the form

    I think it has something to do with collections, but I dont know anything about them. How can I do this?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Each form has a Controls collection, which will contain all the controls on the form - incidentally controls that contain other controls, a la the Panel and others, also have a Controls collection which contains all controls that live inside the parent control.

    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWindowsFormsFormControlCollectionClassTopic.htm
    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemwindowsformsformcontrolcollectionmemberstopic.htm

    Seems to me like you could examine the collection a lot like any other kind of collection, using .IndexOf to find particular controls or .Count to determine how many controls and then walk through each one in a loop... For your task the first thing I'd try is looping through all the controls in the collection and examining every PictureBox type? I dunno, I haven't tried something like that yet. Good luck.

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