{"id":10413,"date":"2011-06-16T07:00:00","date_gmt":"2011-06-16T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/06\/16\/how-do-i-create-a-right-aligned-toolbar-button\/"},"modified":"2011-06-16T07:00:00","modified_gmt":"2011-06-16T07:00:00","slug":"how-do-i-create-a-right-aligned-toolbar-button","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20110616-00\/?p=10413","title":{"rendered":"How do I create a right-aligned toolbar button?"},"content":{"rendered":"<p>I didn&#8217;t think this was all that common a request, but it came in twice from two different customers, so I guess there are still people creating toolbars, and creating them with right-aligned buttons (even though it violates Windows user interface guidelines, though I can&#8217;t find a citation right now).\n You may have noticed that the toolbar common control doesn&#8217;t provide a facility for creating right-aligned buttons. Partly because it&#8217;s a violation of the guidelines anyway, but mostly because the default state of every feature is &#8220;not implemented.&#8221; <a href=\"http:\/\/blogs.msdn.com\/53298.aspx\"> Adding a feature requires work<\/a>, and since there is only a finite amount of work available to apply, you have to decide where to spend it. And generally speaking, you don&#8217;t <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2007\/07\/19\/3945339.aspx\"> focus your efforts on helping people violate the guidelines<\/a>.<\/p>\n<p> If you want to create a right-aligned toolbar button, you can cobble one together by combining things you already have. I can think of two ways of doing this off the top of my head. <\/p>\n<ul>\n<li>Create two toolbars, one for the left-aligned buttons and     one for the right-aligned buttons, then size and position     them appropriately. <\/li>\n<li>Create a separator between the left-aligned buttons and     the right-aligned buttons, and set the separator size appropriately. <\/li>\n<\/ul>\n<p> Which comes to a third reason why there is no feature for right-aligned toolbar buttons: Because you can already do it yourself without too much effort. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I didn&#8217;t think this was all that common a request, but it came in twice from two different customers, so I guess there are still people creating toolbars, and creating them with right-aligned buttons (even though it violates Windows user interface guidelines, though I can&#8217;t find a citation right now). You may have noticed that [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-10413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>I didn&#8217;t think this was all that common a request, but it came in twice from two different customers, so I guess there are still people creating toolbars, and creating them with right-aligned buttons (even though it violates Windows user interface guidelines, though I can&#8217;t find a citation right now). You may have noticed that [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/10413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=10413"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/10413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=10413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=10413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=10413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}