I've got a couple Qs.
I'm using the ExplorerBar and I'm having trouble with images. I want a separate image for each group, and for each item in those groups. I can't seem to make that happen. I've looked at the articles and other forum posts but nothing seems to work. I created an image list and assigned each group and each item to an image, but still nothing. I've done it for both Large and Small appearances.
Any ideas?
Also, I'd like to use the ribbon control but it's not in my control list. Does it not come with winforms?
Hello Sean,
Thank you for posting. I have attached a simple sample application to demonstrates adding images to the ExplorerBar header and to the items.
In order to add image to the item you could use this code:
aGroup.Items[0].Settings.Enabled = DefaultableBoolean.False; aGroup.Items[0].Settings.AppearancesSmall.Appearance.Image = myImage;
To add an images to the group header you could use this code:
foreach (UltraExplorerBarGroup group in ultraExplorerBar1.Groups) { group.Settings.AppearancesSmall.HeaderAppearance.Image = myImage; }
In the sample I have also demonstrated how can you change the image of the expansion indicator, if you are interested .
Please let me know if you need further assistance.
Sincerely,Divya JainAssociate Software Developer
please find the attached sample.
ExplorerBarGroupImage.zip
You can create the ribbon using UltraToolbarmanager control from the control .toolBox.For more information refer to this online help document.
I am not very sure about your requirement, is it a tooltip? Could you provide a screenshot of your orange square gradient?
As you are talking about gradient I believe you are using isl and most probably this orange gradient is coming from that only.In that case, you have to modify the isl itself to remove/modify the orange gradient, open up the isl in AppStylist and then reset roles and states one at a time until it goes away.If you are not able to achieve it provide your isl file applied to my sample and attach it here for me to find that role for you.
Ok, I've taken a look at your project and it doesn't do everything I need. I need a separate image for each group header. I was able to alter your project to do that and it looks good. However, you're creating all the groups manually in code. I created mine in the designer. So when I create extra groups in your project I have no problem getting different images on all the group headers. But nothing I do duplicates that in my project where I've created the groups in the designer.
Can it be done? I've tried it in code, and I've added an ImageList and assigned each group an image from that list and still nothing. I've even added another ExplorerBar control in case I messed up the settings on the other one. But nothing I do will give me separate images there either I can only add the same image to all the groups.
The properties of the control are the same at design-time as they are at run-time. So to apply an image to a group (from an image list), you would do this:
1) Set the ImageListLarge property on the ExplorerBar to your ImageList that contains your large images. I am assuming you want to use large images for groups, as that's the standard, but you could use small images, as well, if you want. You can set this property on the property grid at design-time and the dropdown list will show you a list of all of the ImageLists on your form so you can choose one. Also... presumably, the ImageSize on your ImageList matches the ImageSizeLarge on the Explorer.
2) Click on the ExplorerBar and go to the Groups property. Click on the ellipsis to open up the UltraExplorerBar designer.
3) On the left is a tree with the UltraExplorerBar control at the top and a list of groups under that (assuming you have defined the groups). Select the group you want.
4) The selected group's properties are displayed on the right. Expand Settings-->AppearanceLarge and find the HeaderAppearance property. This is the same property being set at run-time.
5) Go to the image property and click the ellipsis. This brings up the image editor where you can choose an image from a file, edit an image, or choose an image from your ImageList.
Yeah, I did exactly that and it didn't work. In fact, the only thing that does work is when I create the menu items in code and set the images there.
I'm also having some style issues with components in general as they're proving capricious. They seem to apply to some controls and not to others. For instance, I have a grid style that I've set in AppStylist. It will be applied to grids partially. So like the header styles will be applied, but the scrollbar and row styles will be ignored. Then I create a new grid on a new page and the styles aren't applied at all until I set the StyleName. But other grids don't have to have the StyleName set. One grid has StyleName set but the row styles aren't applied until I set the StyleName for the row appearance itself.
Even in AppStylist itself when I change the color of a property, say the grid header, the color previews just fine. But the styles for scrollbar and alternate rows don't preview at all.
Sean McCown said:Yeah, I did exactly that and it didn't work.
Can you be more specific? What didn't work? Are you saying you assigned an image to the group and it doesn't display? Or were you unable to select an image for some reason?
Sean McCown said:In fact, the only thing that does work is when I create the menu items in code and set the images there.
What do you mean by "Menu Items?" Your question here is about groups.
Sean McCown said:I'm also having some style issues with components in general as they're proving capricious. They seem to apply to some controls and not to others. For instance, I have a grid style that I've set in AppStylist. It will be applied to grids partially. So like the header styles will be applied, but the scrollbar and row styles will be ignored.
In the style library (which you can edit via AppStylist) there is a property on each control role called ResolutionOrder. It sounds to me like you have set your ResolutionOrder to ControlThenApplication - which means that settings applied to the control (on the Appearance properties) override the styling. It's also possible that your Style Library is not turning off themes. But I'm only guessing, since you didn't post the isl file here. The resolution process is pretty complex, so it's really hard to tell what's happening without a sample. If you provide a small sample project and your isl file and tell me which parts are giving you trouble, I will be happy to take a look.
Sean McCown said:Then I create a new grid on a new page and the styles aren't applied at all until I set the StyleName. But other grids don't have to have the StyleName set. One grid has StyleName set but the row styles aren't applied until I set the StyleName for the row appearance itself.
I'm not familiar with any property called StyleName. Do you mean StyleLibraryName? Or StyleSetName? Those are properties on the control.
Or are you talking about StyleLibraryName or StyleResourceName on an Appearance object?
Sean McCown said:Even in AppStylist itself when I change the color of a property, say the grid header, the color previews just fine. But the styles for scrollbar and alternate rows don't preview at all.
Which role are you setting a color on? I tried this in AppStylist with a new Style Library and it works fine. But when you create a new Style Library (or StyleSet) AppStylist will prompt you to turn off themes and the prompt explains that if you choose not to do so, some styling will not work, because Windows Themes drawing is all or nothing. So if setting a color on a particular role, such as the ScrollBarButton, for example, doesn't work - my guess is that you chose not to turn off themes. To test that theory... what you could do is go to that same role and look in the "Other" section at the bottom where it says "Themed Element Alpha" and set it to Transparent. If that fixes it, then that would indicate you didn't turn off themes and that might explain a lot of the issues you are having.
Rows are not themed, though, so that would not explain the AlternateRows not working. That seems more likely to be a result of the ResolutonOrder on a component role.
Thank you for the update.
I am glad that you resolved the issue.
Thanks Mike, that did the trick. I was away at a conf last wk, but I just tried it and it works fine. I've got some other styling issues but I'll start individual threads for those.
Sean McCown said:When I added images (to both small and large appearances), they added just fine, but didn't display in the rendered object.
If you add the images and then go back in into the group designer at design-time, are all of the images still there? If not, then something is wrong on your system and the images are not getting serialized properly. That seems unlikely.
If they are still there, the the only explanation as to why they don't show up at run-time is that something in your code is clearing them out. Either removing the images, the ImageList, or maybe it's removing all of the groups and adding new ones.
That's the only thing I can think of that would possibly cause that.
Sean McCown said:I've attached my isl. I'll try to see if I can put together a project that has the same issues. For the record, I've tried it with all ResolutionOrder values and while it changes what the grid looks like, it still doesn't use all the styles.
I loaded your isl into AppStylist and I went to the grid tab, and I can see thatyour isl is, in fact, turning off themes. So that's good. And I can see that the scrollbars looks gray like the windows default and do not appear to be styled. And I see that your isl has a BackColor applied to the ScrollBar UIRole and the two child roles: ScrollBarVertical and ScrollbarHorizontal. And if I create a new isl and use those roles (or even just the ScrollBar role), it works. And the same is true on the UltraTree, so it's not specific to the grid.
So that says to me that there is some other role that is causing that role not to work. It's pretty tough to track this kind of thing down. It's process or elimination to figure out which other role is causing an issue. So what I do in a case like this is open up the isl and select the root-level role on the tree and press "*". This expands the entire tree. Then I go down the list and reset each role one at a time until I find the one that makes the ScrollBar styling show up. So I tried that and still couldn't get it to work.
But I ended up reducing it down to a very simple isl with nothing but the base and the ScrollBar roles. So that narrowed it down. The problem is the base role. You are explicitly applying a BackColor to the Base role. That means EVERY role on every object is going to resolve that color and it's going to cause all sorts of weird behavior. So you should never do that. The only thing you can really use the Base role for is to turn off themes.
So if you go to your Base role and reset the BackColor, that fixes it. You are also setting a couple of other properties on the Base role, so I recommend that you Reset the base role, then set Themed Element Alpha on the Base role to Transparent, so there's nothing else set on there. That will help you avoid problems like this in the future.
Ok, I'll be more clear.
When I added images (to both small and large appearances), they added just fine, but didn't display in the rendered object.
Yes, I meant StyleLibraryName.
By menu items, I mean groups. It's functioning as my menu so I called them menu items. But yeah, I have the same problems with both groups and group items.
I've attached my isl. I'll try to see if I can put together a project that has the same issues. For the record, I've tried it with all ResolutionOrder values and while it changes what the grid looks like, it still doesn't use all the styles.
Ok, here's my file. It made me zip it before I could upload.MenuBarME.zip