{"id":65213,"date":"2007-03-28T03:04:00","date_gmt":"2007-03-28T03:04:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2007\/03\/28\/how-can-i-change-the-color-of-the-scrollbars-in-an-hta\/"},"modified":"2007-03-28T03:04:00","modified_gmt":"2007-03-28T03:04:00","slug":"how-can-i-change-the-color-of-the-scrollbars-in-an-hta","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/how-can-i-change-the-color-of-the-scrollbars-in-an-hta\/","title":{"rendered":"How Can I Change the Color of the Scrollbars in an HTA?"},"content":{"rendered":"<p><H2><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" height=\"34\" alt=\"Hey, Scripting Guy! Question\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\"> <\/H2>\n<P>Hey, Scripting Guy! How can I change the color of the scrollbars in an HTA?<BR><BR>&#8212; IR<\/P><IMG height=\"5\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" border=\"0\"><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" height=\"34\" alt=\"Hey, Scripting Guy! Answer\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\"><A href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><IMG class=\"farGraphic\" title=\"Script Center\" height=\"288\" alt=\"Script Center\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" align=\"right\" border=\"0\"><\/A> \n<P>Hey, IR. How many times have you thought to yourself, \u201cGee, the Scripting Guy who writes that column is so smart; how come he isn\u2019t rich?\u201d (OK, true, you\u2019ve probably <I>never<\/I> thought that. But just play along, OK?) Well, it turns out that there\u2019s a very simple explanation for this: he\u2019s too far out-of-touch with the modern world.<\/P>\n<P>For example, last night the Scripting Guy who writes this column read about a company that converts your physical mail (you know, the kind that the post office delivers) to email. If you\u2019re like most people, apparently you don\u2019t have time to open up the mailbox and go through your mail. Well, thanks to this new company \u2013 which expects to soon become a multi-billion dollar company \u2013 that\u2019s something you\u2019ll never have to worry about. Instead of having mail delivered to your home or office, you can have your mail forwarded to this company. In turn, trained representatives will open each and every envelope, scan the items into the computer, and then send the scanned images to you via email. You\u2019ll never have to touch a grimy old mailbox again!<\/P>\n<P>It\u2019s safe to say the Scripting Guy who writes this column would <I>never<\/I> have come up with an idea like that, not in million years. After all, he still trundles down to the mailbox every day, retrieves his own mail, and then \u2013 we hope you\u2019re sitting down here \u2013 he opens his own envelopes and reads the actual physical contents of each letter! And he never, <I>ever<\/I> digitizes that mail! The flyer for the local hardware store? The solicitation from the Art Museum? The invitation to learn about real estate opportunities or to buy 1 get 1 free at the Mexican restaurant (Monday through Thursday, 12:00 PM to 2:00 PM only)? Gone, all gone. What is he <I>thinking<\/I>?!?<\/P>\n<TABLE class=\"dataTable\" id=\"ELD\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\"><B>Note<\/B>. To tell you the truth, he\u2019s thinking, \u201cWhy in the world would I pay someone $20 a month (the subscription rate to this new service) to digitize all my mail and send it to me via email?\u201d Sadly, it\u2019s thinking like that which is helping to hold back the march of progress.<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<DIV class=\"dataTableBottomMargin\"><\/DIV>\n<P>But you know what they say: it\u2019s always easy to teach an old dog new tricks. (Or something like that; we weren\u2019t paying very close attention when they said whatever it is they said.) With that in mind, rather than type in the code that shows you how to change the color of the scrollbars in an HTA we decided to get with the times, take a screenshot of our solution, and then present you with a digitized version of the script. Here you go, IR:<\/P><IMG height=\"221\" alt=\"HTA\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/digitized.jpg\" width=\"300\" border=\"0\"> \n<P><BR>What\u2019s that? Well, we\u2019re not saying that it\u2019s <I>easy<\/I> to read \u2026 did you try squinting your eyes a little? Give that a try.<\/P>\n<P>You\u2019re right; that just makes it worse, doesn\u2019t it?<\/P>\n<P>OK, so maybe our business model needs a little more work; among other things, we haven\u2019t exactly figured out how to get people to pay $20 a month for the chance to get copies of scripts they won\u2019t be able to read. With that in mind, and while we reassess the business plan, here\u2019s an old-fashioned way of looking at the code:<\/P><PRE class=\"codeSample\">&lt;STYLE&gt;\n  BODY {scrollbar-face-color:red; scrollbar-arrow-color:blue; scrollbar-track-color:green }\n&lt;\/STYLE&gt;\n<\/PRE>\n<P>Yes, we know: it\u2019s painful to have to read things in the old-fashioned way, isn\u2019t it? On the bright side, though, at least there isn\u2019t much to read here. As you can see, all we\u2019re doing is defining a style for the body of our HTA; in particular we\u2019re assigning values to three different properties:<\/P>\n<TABLE class=\"\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n<TBODY>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>Scrollbar-face-color, which sets or retrieves the color of the scroll box and scroll arrows of a scroll bar.<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>Scrollbar-arrow-color, which sets or retrieves the color of the arrow elements of a scroll arrow.<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>Scrollbar-track-color, which sets or retrieves the color of the track element of a scroll bar.<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P>Best of all, the syntax for assigning a value to one of these properties is pretty simple: you just reference the property name followed by a colon followed by the assigned value (e.g., <B>scrollbar-face-color:red<\/B>). If we want to assign values to more than one property all we have to do is separate those individual properties using semicolons. <\/P>\n<P>And not some kind of digitized, virtual semicolon. These are <I>real<\/I> semicolons, the kind that Ernest Hemingway used to use.<\/P>\n<TABLE class=\"dataTable\" id=\"EWE\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\"><B>Note to the Scripting Editor<\/B>. When you get back into town, make sure that Ernest Hemingway actually <I>used<\/I> semicolons. Also, see if you can out who Ernest Hemingway is.<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<DIV class=\"dataTableBottomMargin\"><\/DIV>\n<P>Of course, some of you might be concerned that, having shown you how to set the preceding three scrollbar properties there\u2019s now nothing left for you to learn on your own. Perish the thought! Here are some additional scrollbar properties that we haven\u2019t worked with:<\/P>\n<TABLE class=\"\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n<TBODY>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P><B>Scrollbar-3dlight-color<\/B>, which sets or retrieves the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P><B>Scrollbar-base-color<\/B>, which sets or retrieves the color of the main elements of a scroll bar, which include the scroll box, track, and scroll arrows.<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P><B>Scrollbar-darkshadow-color<\/B>, which sets or retrieves the color of the gutter of a scroll bar.<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P><B>Scrollbar-highlight-color<\/B>, which sets or retrieves the color of the top and left edges of the scroll box and scroll arrows of a scroll bar.<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P><B>Scrollbar-shadow-color<\/B>, which sets or retrieves the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P>And what colors can you set these properties to? For starters, how about the colors found in the Cascading Style Sheets <B>reference documentation<\/B>?<\/P>\n<P>Meanwhile, the Scripting Guy who writes this column has come up with a newer, and even better, idea: he\u2019ll have people\u2019s email forwarded to him, then he\u2019ll print out those emails and pop them into the regular mail. Tired of getting too much email and too much spam? No problem; with this new service you\u2019ll never get <I>any<\/I> email! To sign up for our introductory price of $19.95 a month, just send your credit card number to scripter@microsoft.com.<\/P>\n<TABLE class=\"dataTable\" id=\"EKG\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P class=\"lastInCell\"><B>Note<\/B>. This is the spot where the Scripting Editor would usually note, \u201cPlease do <I>not<\/I> send your credit card number to scripter@microsoft.com.\u201d Because the Scripting Editor is out of town, we\u2019ll take care of that for her: \u201cPlease do <I>not<\/I> send your credit card number to scripter@microsoft.com.\u201d Send cash instead.<\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! How can I change the color of the scrollbars in an HTA?&#8212; IR Hey, IR. How many times have you thought to yourself, \u201cGee, the Scripting Guy who writes that column is so smart; how come he isn\u2019t rich?\u201d (OK, true, you\u2019ve probably never thought that. But just play along, OK?) Well, [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3,4,5,30],"class_list":["post-65213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-scripting-guy","tag-scripting-techniques","tag-vbscript","tag-web-pages-and-htas"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! How can I change the color of the scrollbars in an HTA?&#8212; IR Hey, IR. How many times have you thought to yourself, \u201cGee, the Scripting Guy who writes that column is so smart; how come he isn\u2019t rich?\u201d (OK, true, you\u2019ve probably never thought that. But just play along, OK?) Well, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/65213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=65213"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/65213\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=65213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=65213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=65213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}