Results 1 to 5 of 5

Thread: Need help

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    7

    Thumbs up Need help

    Hey guys I've just begun coding in visual basic 2008 at my school and I would like to know how would i got about implementing a logon and adding photos into a combobox as I am making a shop program for an assessment.
    If you guys could give me any advice that would be great too thanks.

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

    Re: Need help

    For future reference, please provide meaningful titles for your threads. The title is supposed to allow us to see which threads are relevant. A title like "Need help" means nothing because everyone who posts needs help, so titles like that mean that we have to waste our time opening every single thread to find the relevant ones. To make providing meaningful titles possible, please keep each thread to a single topic and each topic to a single thread. You've asked two basically unrelated questions in one thread so it's hard to provide a succinct title. If the thread only relates to one topic then it's easy to provide a title that summarises that topic.

    With regards to implementing login functionality, follow the CodeBank link in my signature and check out my WinForms Login thread.

    With regards to the photos in the ComboBox, do you actually want to display the photos inside the control or make a selection and display the corresponding image elsewhere? The latter is relatively simple while the former is not possible without drawing the items in the ComboBox yourself, which is basically too complicated for a schol student who has just started programming.
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    7

    Re: Need help

    Quote Originally Posted by jmcilhinney View Post
    For future reference, please provide meaningful titles for your threads. The title is supposed to allow us to see which threads are relevant. A title like "Need help" means nothing because everyone who posts needs help, so titles like that mean that we have to waste our time opening every single thread to find the relevant ones. To make providing meaningful titles possible, please keep each thread to a single topic and each topic to a single thread. You've asked two basically unrelated questions in one thread so it's hard to provide a succinct title. If the thread only relates to one topic then it's easy to provide a title that summarises that topic.

    With regards to implementing login functionality, follow the CodeBank link in my signature and check out my WinForms Login thread.

    With regards to the photos in the ComboBox, do you actually want to display the photos inside the control or make a selection and display the corresponding image elsewhere? The latter is relatively simple while the former is not possible without drawing the items in the ComboBox yourself, which is basically too complicated for a schol student who has just started programming.
    Sorry about that ok well i want it display the image inside the combobox

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

    Re: Need help

    In that case, you need to set the DrawMode of the ComboBox to one of the OwnerDraw values and draw the items yourself. I'm quite sure that you will be able to find examples online and that DrawMode property and/or the DrawItem event are where you should start.
    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

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: Need help

    You might also want to play around with the ListView, which is better designed for using pictures as items, but doesn't have the drop-down functionality inherently. If you are willing to settle for scrolling, then the ListView will handle the images directly (though the ListView is such a strangely versatile control that it has a bewildering assortment of settings...the key one for you is Mode = Details, or something close to that). To cause that to act as a dropdown would be a bit odd, but I would suggest that it be a ListView showing images with a button to the right of it showing a down arrow. When you click the down arrow you would expand the size of the Listview from 1 item in height to N items in height (based on the amount of room you have). You'd also have to get the scrolling right so that when it expanded to N items, the item that was being displayed at 1 item height because the top item, or the selected item, or whatever else looks best. It would be a bit weird.
    My usual boring signature: Nothing

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