Results 1 to 13 of 13

Thread: [RESOLVED] Rounded Combobox

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Resolved [RESOLVED] Rounded Combobox

    Why does the dropdown arrow disappears when I try to use the following code? Is there any other method which I can round out the corners of the combobox? Thanks!

    Code:
    <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
        <Grid>
            <Border x:Name="border" Background="White" BorderBrush="#FFFFC934" BorderThickness="2" CornerRadius="10,10,10,10" Width="Auto" Height="Auto">
            </Border>
        </Grid>
    </ControlTemplate>
    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

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Rounded Combobox

    I'm no expert on control templates but I think when you define a control template you are defining the entire control. So the combobox that you apply that template to will be JUST that border that you have defined and nothing else - hence the drop down arrow disappearing.
    From what I remember, you can assign special names to "parts" of your control template and then WPF will treat them in the same way as their standard control counterpart. For example the little dropdown arrow might be named PART_DropDown in the standard combobox control template, so if you define something in your template and name it that same name then WPF will make it do the same things as the normal one would do (but without the same visual effects obviously as thats for you to define). I'm not sure whether the little arrow in a combobox is actually a separate part though, but you can find out by using Expression Blend to edit a copy of the combobox control template and examining the 'internals' of it.

    Sorry if any of the above is not 100&#37; correct but its been a while since I did anything like that. Have a look on the web for Control Template tutorials
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Rounded Combobox

    Upon searching and trial and error I was able to get the look that I want. It occured to me that a ComboBox is composed of various controls and I needed to modify the borders of those controls to suit my needs. Attached is a sample project that has the modified control template if anyone is interested.
    Attached Images Attached Images  
    Attached Files Attached Files
    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

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Rounded Combobox

    Nice
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [RESOLVED] Rounded Combobox

    Subscribed
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    New Member
    Join Date
    Apr 2011
    Posts
    2

    Re: [RESOLVED] Rounded Combobox

    Hi dee-u,
    Attached project that helps a lot for the rounded combobox
    Do you have all other controls template
    if yes please attach only the control templates..i just wanted to explore all this

    Thanks
    decuser.

  7. #7

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: [RESOLVED] Rounded Combobox

    Quote Originally Posted by decuser View Post
    Hi dee-u,
    Attached project that helps a lot for the rounded combobox
    Do you have all other controls template
    if yes please attach only the control templates..i just wanted to explore all this

    Thanks
    decuser.
    You can try searching them in MSDN.
    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

  8. #8
    New Member
    Join Date
    Apr 2011
    Posts
    2

    Re: [RESOLVED] Rounded Combobox

    Hi,

    I am interested in control templates of the control available in the NetVerse screen.I searched MSDN couldn;t get the ones i wanted.
    I saw your netverse screen and with you sample project i could see only combobox template not the other ones..i just need the button,textbox templates as available in the screen

    kindly help me

    thanks
    decuser

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [RESOLVED] Rounded Combobox

    All the rounded control templates are in the netverser project. This one is just for hte rounded combobox
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [RESOLVED] Rounded Combobox

    Here is the link to the project in CodeBank
    http://www.vbforums.com/showthread.p...18#post3631718

    Check out the NetVerserStyles.xaml file
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11
    New Member
    Join Date
    Mar 2013
    Posts
    1

    Thumbs up Re: [RESOLVED] Rounded Combobox

    Great example! I have one question: how is the gradient around the combobox controlled? I've set almost every color to #FFF and nothing seems to change it. Thanks for any help you can offer.

  12. #12
    Registered User
    Join Date
    Aug 2015
    Posts
    1

    Re: [RESOLVED] Rounded Combobox

    can't find attachment WpfApplication1.zip . Please upload again....

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    Re: [RESOLVED] Rounded Combobox

    Quote Originally Posted by makanimanthan View Post
    can't find attachment WpfApplication1.zip . Please upload again....
    Its in post #3
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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