Results 1 to 10 of 10

Thread: WPF Forms

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    WPF Forms

    I have 2 questions the first one is about the toolbar control in wpf. I just want it to look like a normal bar without the "ribbon dropdown thingamajig", is that possible? The other one is when I click a button in wpf I want it to look like its clicked and when I click it again I want it released. Is this possible and if so any links or help is appreciated.
    If I helped you please rate me.

  2. #2

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: WPF Forms

    not sure about the toolbnar issue.... but for the button, try a checkbox with its style set to "graphical" (I think that's right) that will make it look like a button that can be toggled on & off.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: WPF Forms

    Thanks didnt realize there was a wpf forum lol. I tried doing the checkbox thing techgnome but I could not find the setting to change to graphical. A little help. Also any mod please move this to the WPF forum and sorry for the inconvenience
    If I helped you please rate me.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: WPF Forms

    Thread moved to "WPF, WCF, WF" forum

    (thanks for letting us know tg )

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

    Re: WPF Forms

    Quote Originally Posted by ngreenwood6 View Post
    I tried doing the checkbox thing techgnome but I could not find the setting to change to graphical. A little help. Also any mod please move this to the WPF forum and sorry for the inconvenience
    The CheckBox and RadioButton classes both inherit the ToggleButton class, which is not in the Toolbox. If you add a CheckBox and then change the XAML to <ToggleButton> instead then you'll get the effect you're looking for.

    Note that I've never actually used WPF before and I just found that information by Googling checkbox button wpf, following a link to StackOverflow and then looking up MSDN for the ToggleButton they mentioned.
    Last edited by jmcilhinney; Jul 1st, 2009 at 03:06 AM.
    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

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

    Re: WPF Forms

    Aw I thought for a moment there that JMC had become a WPF user :P
    But yeah I wouldn't rely on the Toolbox to provide all of your controls, there are a couple of useful ones that arent in the default toolbox selection.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

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


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

    Re: WPF Forms

    Quote Originally Posted by chris128 View Post
    Aw I thought for a moment there that JMC had become a WPF user
    I intend to fairly soon. I've been concentrating on ASP.NET MVC for a while but WPF is near the top of my list soonta's
    Quote Originally Posted by chris128 View Post
    But yeah I wouldn't rely on the Toolbox to provide all of your controls, there are a couple of useful ones that arent in the default toolbox selection.
    Oddly, I thought to add the ToggleButton to my Toolbox but the only one I could see in the list was an Office Ribbon component. I guess that they don't intend the ToggleButton to be used directly but rather only as a base class. I guess tg's original advice might be what they intend you to do in this case, much as you do in WinForms with the Appearance property, but all the advice I could find on the subject mentioned the ToggleButton. If it works, I'm happy to use it until I have a concrete reason not to.
    Last edited by jmcilhinney; Jul 1st, 2009 at 05:29 AM.
    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

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

    Re: WPF Forms

    Yeah well it certainly seems to work as you would expect it to so thats what I am going to use when I have need of such a button (although for what I have in mind I think I will need to customise it to work like this one, which is actually more of a combobox but whatever : http://blog.xamltemplates.net/wp-con...obox_style.jpg)
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

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


  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2009
    Posts
    448

    Re: WPF Forms

    Thanks for the help guys I will give it a shot
    If I helped you please rate me.

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