Setting Disabled Icon during run time |
Post Reply |
Author | |
blockwood
Groupie Joined: 23 March 2004 Status: Offline Points: 45 |
Post Options
Thanks(0)
Posted: 08 April 2004 at 10:08pm |
Hi,
can you post code snipped of how to Set Disabled Icon during run time. would the easiest way to do it is to change the IconId property when the enabled/disabled state changes? |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Dim Control As CommandBarControl Set Control = CommandBar.FindControl(, ID_EDIT_COPY,,True) EndIf Yes, you can change IconId, but if you use the ImageManager control you can place your normal, disabled, and hot icons all in one place and it will automatically use them. Just right-click on the ImageManager control and select the Id of the image you want to change the "disabled" icon. If it needs to be 2 different disabled icons, then you simple change IconId to the Id of another Image. Edited by SuperMario |
|
blockwood
Groupie Joined: 23 March 2004 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
you mean
Dim Control As CommandBarControl Set Control = CommandBar.FindControl(, ID_EDIT_COPY,,True) If Not Control Is Nothing Then Control.iconid = DISABLED_ICON_CONSTANT EndIf right? if so that works. thx for reply |
|
blockwood
Groupie Joined: 23 March 2004 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
I've just gotten around to implementing this. I had some disabled icons drawn up.
If you use ImageList control I can't get a disabled icon to display a graphic. it just greys out the block shape of the icon UseDisabledIcons property doesn't seem to have any effect. What I want to do is disable a control and then have it show my custom disabled icon graphic Here is the code I have now Set Control = .Add(xtpControlButton, ID_RUN_STOP, "Stop", -1, False) Control.DescriptionText = "Stop" Control.Enabled = False Control.IconId = DISABLED_SAVE ... ' Use the disabled icons c.Options.UseDisabledIcons = False Is what I'm trying to do possible with ImageList? |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Just use the new ImageManager control, it is allot easier to use.
|
|
blockwood
Groupie Joined: 23 March 2004 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
i don't necessarily agree that it is easier to use, in all cases, because it doesn't support mask edit color - so we would have to rework all of our bitmaps or convert them to gifs. a lot of work to get disabled icons to work.
I appreciate the new ImageManager control and that it abstracts the problem of disabled icons (it will be a great help to people) but for people who have existing apps. designed around imagecontrol - switching to ImageManager is no small task. If there are any suggestions as to how I can convert my existing bitmaps with grey background (used as mask color) to the required ImageManager format I am all ears. We have nearly 80 buttons If not is there a solution to this problem using ImageControl or are disabled icons not a feature that work with ImageControl? So far it is ony issue I have with codejock I haven't been able to figure out - and I have spent probably 50+ hours integrating it into my apps. If I could get disabled icons to work it would be great. TIA - Brian |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
All you need to do is change the "grey" background of the image to the
"Erase" color when you are adding them to the ImageManager
control. Just select the "fill tool" and click on the "Erase"
color and change the "grey" to "erase". This might sound like
allot, but it take less than a minute to do each image. If you are
using Alpha icons, then the transparency layer will be used by the
ImageManager control and you will not need to use the "Erase" color.
Edited by SuperMario |
|
blockwood
Groupie Joined: 23 March 2004 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
actually i have found out a better solution.
first - I made an assumption that was erroneous. I figured codejock could not automatically change image to disabled colors by itself! codejock can - how I don't know. but it's a great feature. I *assumed* you needed to create a disabled icon and handle it programmatically - nope - cojejock does this for you. the problem is - if you set theme after loading toolbar this neat disabled effect is lost and the image is just blocked out. to get it back just add .Options.UseDisabledIcons = True .RecalcLayout each time you set the theme so my code looks like this With CommandBars .VisualTheme = Id .Options.UseDisabledIcons = True .RecalcLayout End With you no longer need to worry about creating custom disabled icons or managing it programmatically. just disable and enable buttons and codejock will do the rest. |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
I thought you wanted to use your own "custom" disabled icon. That
is why i suggested to use the ImageManager control, it makes it wasy to
add your own disabled icon.
|
|
blockwood
Groupie Joined: 23 March 2004 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
i "did" but only because i didn't realize codejock had integral disabled icon functionality built in.
with this i'm not sure why anybody would want to create their own disabled icon. i still am not a big fan of the ImageManager - and I disagree that even with disabled icons it is "easier" when you factor in you have to manually edit each bitmap, loading images in ImageManager is cumbersome (I can select 100 bitmaps at a time and load them into ImageControl all at once) etc. but the critical point is that it can be done easily with imagecontrol and that codejock will create disable icons on it's own - i think it's an incredible feature |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |