Results 1 to 9 of 9

Thread: [2005] Lot of questions

  1. #1

    Thread Starter
    Hyperactive Member OMITT3D's Avatar
    Join Date
    Mar 2006
    Posts
    368

    [2005] Lot of questions

    How do I make it so when the person maximizes it and changes the form size, it adjusts properly. So like when it's maximized all the stuff gets bigger to fit then window, and when it's made smaller everything else goes smaller..know what I mean?

    How do I add images to a tab control?

    How do I add images to a listbox?
    Last edited by OMITT3D; Apr 28th, 2006 at 05:26 PM.

  2. #2
    "The" RedHeadedLefty
    Join Date
    Aug 2005
    Location
    College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation
    Posts
    4,495

    Re: [2005] Lot of questions

    1. Look into anchoring the controls on the form. You can achieve it with correct anchoring (emphasis on the "correct")

    2. A tab control needs a tabpage first. Then on the Tabpage, you would just add any control you want that could hold the image, like a picturebox control on the tabpage.

    3. Generic Listbox control does not support images. There are various custom controls out that have some kind of functionality like that. You can check out jmcilhinney's signature for some free control links... Or just use a ListView, which should support images.

  3. #3

    Thread Starter
    Hyperactive Member OMITT3D's Avatar
    Join Date
    Mar 2006
    Posts
    368

    Re: [2005] Lot of questions

    For #2 I don't think you understood me. By default it adds TabPage1 tab and TabPage2 tab i want the image to go on that tab itself if that makes sense. So like [Img]TabPage1 of course I'd change TabPage1 to w/e I want just an example.

  4. #4
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Re: [2005] Lot of questions

    If you mean the tabs themselves, you would have to ownerdraw them. MSDN has a good example here:

    http://msdn2.microsoft.com/en-us/lib....drawmode.aspx

    Which you could easily modify by using a DrawImage command instead of DrawRectangle..

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  5. #5

    Thread Starter
    Hyperactive Member OMITT3D's Avatar
    Join Date
    Mar 2006
    Posts
    368

    Re: [2005] Lot of questions

    Sorry can you give the syntax of DrawImage I tried using
    ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/cpref8/html/M_System_Drawing_Graphics_DrawImage_1_ea916583.htm
    but it wasn't working. I got it sorta but it stetches accross the whole tabpage and isn't just in the cornor of it. And by doing tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed that makes the tabpage look kinda ugly

    As for #2 Docking seems to be what I want I think because they are all in one TabControl, and I'll look into #3 when I get done with #1 + #2 =p
    Last edited by OMITT3D; Apr 28th, 2006 at 08:17 PM.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,439

    Re: [2005] Lot of questions

    For images on tabs you create an ImageList and assign it to the ImageList property of the TabControl. You then set the ImageKey or ImageIndex property of each TabPage to access the desired Image. ImageKey corresponds to the Name property you gave the Image when you added it to the ImageList.

    Also, .NET 2.0 has far more advanced capabilities when it comes to moving controls around when a form resizes thanks to the TableLayoutPanel and FlowLayoutPanel. In simple cases Dock and Anchor may be enough, but these new controls give you much more control. The VB Express videos (see my sig for link) have an episode dedicated to each.
    Attached Images Attached Images  

  7. #7

    Thread Starter
    Hyperactive Member OMITT3D's Avatar
    Join Date
    Mar 2006
    Posts
    368

    Re: [2005] Lot of questions

    Ahh the key was to add an imagelist gotcha =). I saw image list but it just said none and you couldn't add anything. Thanks, I'll check out tree view next =D...Nice GUI btw I'll attach mine so far
    Attached Images Attached Images  
    Last edited by OMITT3D; Apr 28th, 2006 at 11:46 PM.

  8. #8
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Re: [2005] Lot of questions

    Now, had you said "Icons" I would have said that bit too

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  9. #9
    Frenzied Member zuperman's Avatar
    Join Date
    Dec 2000
    Location
    Portugal
    Posts
    1,033

    Re: [2005] Lot of questions

    Quote Originally Posted by jmcilhinney
    For images on tabs you create an ImageList and assign it to the ImageList property of the TabControl. You then set the ImageKey or ImageIndex property of each TabPage to access the desired Image. ImageKey corresponds to the Name property you gave the Image when you added it to the ImageList.

    Also, .NET 2.0 has far more advanced capabilities when it comes to moving controls around when a form resizes thanks to the TableLayoutPanel and FlowLayoutPanel. In simple cases Dock and Anchor may be enough, but these new controls give you much more control. The VB Express videos (see my sig for link) have an episode dedicated to each.
    famfamfam rulez nice UI
    Help keep this forum clean: Remember to mark your thread as resolved Search before you post Remember to rate posts that help

    VS2010: Visual Studio 2010 Keybinding Posters
    Service Pack 1
    Tools: GhostDoc - automatically generates XML documentation comments
    NuGet package Manager PowerCommands IDE extensions
    Source Control: ankhsvn - integration for SVN
    Windows Shell Extension for Subversion

    Development Laptop: Intel Core i5 430M 2.26 GHz @ 2.53 GHz
    4096 MB, DDR3 PC3-8500F (533 MHz), Kingston ATI Mobility Radeon HD 5470 15.6 @ 16:9, 1366x768 pixel, HD LED LCD

    I follow:
    JoelOnSoftware - A weblog by Joel Spolsky, a programmer working in New York City, about software and software companies
    ScottGu's Blog - Scott Guthrie works for Microsoft as the Product Manager of the .NET Framework
    Portugal-a-Programar - Portuguese Developers Community
    .NET Rocks! - is a weekly Internet audio talk show for .NET Developers.

    Programming Languages:
    C#
    VB.NET JAVA PHP Javascript
    Other:
    XML
    HTML CSS JQuery SQL



    *** Proudly Portuguese ***

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