Results 1 to 6 of 6

Thread: [RESOLVED] Itemlist Custom control?

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Resolved [RESOLVED] Itemlist Custom control?

    Hi,

    I did try to build a custom control but unfortunately i couldn't make it work due to lack of knowledge.
    Does anyone has any simple example about creating custom controls?

    Shortly: I wanted to build an custom itemlist that allowed me to add 2 or 3 icons beneath it with labels associated.


    Thanks in advance
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Itemlist Custom control?

    Not really sure what you mean by an "ItemList". Sounds like a ListBox. Can you elaborate, maybe cook up a "screenshot" in paint or whatever?

    Anyway, first of all you'll have to differentiate between a custom control and a UserControl.

    A UserControl is a 'container' of other existing controls. See it as a 'template', which you create once (just like a form) and can drag to any form as many times as you like. A UserControl often contains multiple controls, such as a TextBox with a ToolStrip above it, or a bunch of Buttons combined into one control.

    A custom control is a class that inherits an existing control, such as a TextBox, ListBox, Button, or whatever. This way, you can extend that control with your own behavior. You can, for most controls, control the way the control draws itself for example.


    Judging by your description, you want a UserControl, but I can't be sure.

    I've made a bunch of custom controls (might be a UserControl or two in there too), most of which are listed in my signature. Check them out for examples.

  3. #3

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Itemlist Custom control?

    I would like to use a ListBox...attached a small example of what i would like to build, note that in a near future i would like to implement the same solution but in a windows mobile 6.1 or 6.5 professional.

    Thanks for your help!
    Attached Images Attached Images  
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  4. #4
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Itemlist Custom control?

    A usercontrol would probably be best in this situation. You can make it to look like an individual block of that picture. And then create a new instance of one per customer (or whatever those names pertain to).

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  5. #5

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Itemlist Custom control?

    I've never work with that kind of programming, would you provide me a small example on how would i have to control each clicked item/sub-item and create those "advanced" items?
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  6. #6

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: Itemlist Custom control?

    Quote Originally Posted by NickThissen View Post
    Not really sure what you mean by an "ItemList". Sounds like a ListBox. Can you elaborate, maybe cook up a "screenshot" in paint or whatever?

    Anyway, first of all you'll have to differentiate between a custom control and a UserControl.

    A UserControl is a 'container' of other existing controls. See it as a 'template', which you create once (just like a form) and can drag to any form as many times as you like. A UserControl often contains multiple controls, such as a TextBox with a ToolStrip above it, or a bunch of Buttons combined into one control.

    A custom control is a class that inherits an existing control, such as a TextBox, ListBox, Button, or whatever. This way, you can extend that control with your own behavior. You can, for most controls, control the way the control draws itself for example.


    Judging by your description, you want a UserControl, but I can't be sure.

    I've made a bunch of custom controls (might be a UserControl or two in there too), most of which are listed in my signature. Check them out for examples.
    Thanks for the tip, i already built the demo using your ColorListBox.vb and made some tweeks so i can add the icons+labels+control colors, etc. Problem is, i can't detect mouse click on those drawed pictures. Also i'm out of ideas on how to workaround the wanted behavior. Any idea?

    Edit:
    Managed to bypass this with the code posted in: http://www.vbforums.com/showthread.php?p=3703233 on #5
    But still, a button up and down behavior would be prefered
    Attached Images Attached Images  
    Last edited by TDQWERTY; May 23rd, 2010 at 03:04 PM.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

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