Home > Archive > Visual Basic Syntax > August 2005 > Progress bar XP style (the green one)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Progress bar XP style (the green one)
|
|
| Guy Cohen 2005-08-22, 7:05 pm |
| Hi all
How do I make the progress bar look like XP style?
TIA
Guy
| |
|
| Use the MS common controls 5.0 (SP2) and then put the XP look in by using
the ususal method of either a seperate MANIFEST file or putting that into a
resource file and calling InitCommonControlsEx.
See
http://www.vbaccelerator.com/home/V..._VB/article.asp
for details.
Dave.
"Guy Cohen" <noemail@please.com> wrote in message
news:uuK2O5xpFHA.3996@TK2MSFTNGP12.phx.gbl...
> Hi all
> How do I make the progress bar look like XP style?
> TIA
> Guy
>
| |
| Guy Cohen 2005-08-23, 7:57 am |
| Hi Dave,
Thank you for the information.
I know the article and I have two additions to it:
1. Command buttons should also be on top of picturebox
2. You can design in XP style if you put the manifest file as
vb6.exe.manifest :)
Why cannot I use common control 6 ??? :(
Guy
"Dave" <Nobody@Nowhere.Com> wrote in message
news:uoVg1VypFHA.3996@TK2MSFTNGP12.phx.gbl...
> Use the MS common controls 5.0 (SP2) and then put the XP look in by using
> the ususal method of either a seperate MANIFEST file or putting that into
> a resource file and calling InitCommonControlsEx.
>
> See
> http://www.vbaccelerator.com/home/V..._VB/article.asp
> for details.
>
> Dave.
>
>
> "Guy Cohen" <noemail@please.com> wrote in message
> news:uuK2O5xpFHA.3996@TK2MSFTNGP12.phx.gbl...
>
>
| |
| Timo Kunze 2005-08-23, 7:57 am |
| Guy Cohen schrieb:
> Why cannot I use common control 6 ??? :(
Unlike Common Controls 5.0, the Common Controls 6.0 are not based on
comctl32.dll. The code, that themes the controls, sits in comctl32.dll,
so Common Controls 6.0 are not themed.
Timo
--
www.TimoSoft-Software.de - the home of ExplorerTreeView
Stop software patents!
| |
| Guy Cohen 2005-08-23, 7:57 am |
| Thank you Timo.
Can I create this progress bar using code only? (no OCX...) ?
If yes - How is it done?
TIA
Guy
"Timo Kunze" <TKunze71216@gmx.de> wrote in message
news:eDOQAi9pFHA.3576@TK2MSFTNGP09.phx.gbl...
> Guy Cohen schrieb:
> Unlike Common Controls 5.0, the Common Controls 6.0 are not based on
> comctl32.dll. The code, that themes the controls, sits in comctl32.dll,
> so Common Controls 6.0 are not themed.
>
> Timo
> --
> www.TimoSoft-Software.de - the home of ExplorerTreeView
> Stop software patents!
| |
|
| If you just want the progress bar without all the rest of the baggage. Make
a dummy app with the full progress bar, take a screen shot, crop the
screenshot to just the progress bar. Now you have a bitmap with your
progress bar, all you need do is expose it bit by bit to emulate the
progress bar. (you'll also need a bitmap of the frame round the progress
bar).
This is a technique known to experts as "cheating".
Dave.
"Guy Cohen" <noemail@please.com> wrote in message
news:O$vkSs9pFHA.3980@TK2MSFTNGP15.phx.gbl...
> Thank you Timo.
>
> Can I create this progress bar using code only? (no OCX...) ?
> If yes - How is it done?
>
> TIA
> Guy
>
>
> "Timo Kunze" <TKunze71216@gmx.de> wrote in message
> news:eDOQAi9pFHA.3576@TK2MSFTNGP09.phx.gbl...
>
>
| |
|
|
"Guy Cohen" <noemail@please.com> wrote in message
news:O$vkSs9pFHA.3980@TK2MSFTNGP15.phx.gbl...
> Can I create this progress bar using code only? (no OCX...) ?
> If yes - How is it done?
>
You can, but it's much too involved to post the code here on the newsgroups.
You have to use the Win32API for pretty much everything. This includes
using CreateWindow (or CreateWindowEx) to create the control, subclassing to
receive notifications, using SendMessage to send messages, etc. Generally,
the best thing to do would be to wrap all the API code into a Class or
UserControl of your own.
The complexity of all of this is one reason why the controls are wrapped
into a custom control. Another reason is that VB is a RAD tool. If it
didn't have the custom controls, or you just choose to use the API to create
the controls yourself from scratch, you might as well be programming in C++.
Usually, it's easier to use Common Controls 5.0 and extend its controls to
use new features added in later versions of Windows that were not
implemented in Common Controls 5.0. However, there are some advantages to
creating controls from scratch beyond just adding functionality not
implemented in the OCX wrappers. One is that you don't have a fairly large
OCX to distribute, if you have one at all. You might also notice a slight
performance improvement, although I doubt very much this would be as
significant as it would have been several years ago (given today's much more
powerful PCs)
Anyway, if you want an example, see the following:
http://btmtz.mvps.org/progressbar/
I'm sure if you searched the web, you could find many more examples (maybe
better, maybe worse). This just happens to be one that I'm aware of. I've
never looked at this example from Brad myself so I can't tell you how good
(or bad) it is. But being familiar with other examples from Brad, I can
assume this one's probably pretty decent.
--
Mike
Microsoft MVP Visual Basic
| |
| Guy Cohen 2005-08-23, 7:02 pm |
| Thanks for the Info Mike!!
It works fine for me!
"MikeD" <nobody@nowhere.edu> wrote in message
news:egaqrK%23pFHA.3520@tk2msftngp13.phx.gbl...
>
> "Guy Cohen" <noemail@please.com> wrote in message
> news:O$vkSs9pFHA.3980@TK2MSFTNGP15.phx.gbl...
>
> You can, but it's much too involved to post the code here on the
> newsgroups. You have to use the Win32API for pretty much everything. This
> includes using CreateWindow (or CreateWindowEx) to create the control,
> subclassing to receive notifications, using SendMessage to send messages,
> etc. Generally, the best thing to do would be to wrap all the API code
> into a Class or UserControl of your own.
>
> The complexity of all of this is one reason why the controls are wrapped
> into a custom control. Another reason is that VB is a RAD tool. If it
> didn't have the custom controls, or you just choose to use the API to
> create the controls yourself from scratch, you might as well be
> programming in C++.
>
> Usually, it's easier to use Common Controls 5.0 and extend its controls to
> use new features added in later versions of Windows that were not
> implemented in Common Controls 5.0. However, there are some advantages to
> creating controls from scratch beyond just adding functionality not
> implemented in the OCX wrappers. One is that you don't have a fairly large
> OCX to distribute, if you have one at all. You might also notice a slight
> performance improvement, although I doubt very much this would be as
> significant as it would have been several years ago (given today's much
> more powerful PCs)
>
> Anyway, if you want an example, see the following:
>
> http://btmtz.mvps.org/progressbar/
>
> I'm sure if you searched the web, you could find many more examples (maybe
> better, maybe worse). This just happens to be one that I'm aware of. I've
> never looked at this example from Brad myself so I can't tell you how good
> (or bad) it is. But being familiar with other examples from Brad, I can
> assume this one's probably pretty decent.
>
> --
> Mike
> Microsoft MVP Visual Basic
>
>
| |
| Timo Kunze 2005-08-23, 7:02 pm |
| Dave schrieb:
> If you just want the progress bar without all the rest of the baggage. Make
> a dummy app with the full progress bar, take a screen shot, crop the
> screenshot to just the progress bar. Now you have a bitmap with your
> progress bar, all you need do is expose it bit by bit to emulate the
> progress bar. (you'll also need a bitmap of the frame round the progress
> bar).
Or simply download this control:
http://www.timosoft-software.de/php...egory&cat_id=10
Timo
--
www.TimoSoft-Software.de - the home of ExplorerTreeView
Stop software patents!
| |
|
| "MikeD" <nobody@nowhere.edu> wrote in :
> the controls yourself from scratch, you might as well be programming in
> C++.
Mike, you helped me before, thanks.
You mention C++ here, I'm a VB programmer, would like to study OS deeper,
so I'm study VC now. I can read the code, but still feel it's difficult to
use(or apply). Any suggestions can share? Please advice.
|
|
|
|
|