Re: [2008] Get part of background image covered by ListView control
1 Attachment(s)
Re: [2008] Get part of background image covered by ListView control
Sorry, I haven't had much time to work on it. It has something to do with the nested nature of the controls, and the fact that you are putting it in the right side panel of the split container. The good news is, there is a solution, I just haven't had time to iron it out.
You can see that if you have the control on the left side panel of the split container, it does line up correctly. It is the left one (being offset by a container) that is still off (it's actually grabbing the same image, since it is not calculating an offset for the split container). The solution isn't just to offset for the left panel, it should be something more universal to the problem.
Re: [2008] Get part of background image covered by ListView control
Thank you for all your help so far. I don't mean to be rude or ungrateful, but the deadline for this project is Monday morning (1 week from now) and it would be awesome if you could provide an effective solution before that date. If not, I guess I'll just have to stick with the manual offset tweaks...
Re: [2008] Get part of background image covered by ListView control
I hear ya.. I am sure we could come up with a workable solution for just the given scenario, but how will that play out on something like a split container that is split horizontally. I just figure make the offset work no matter what the case is.
Re: [2008] Get part of background image covered by ListView control
I'll leave the matter in your capable hands then :) Thanks again
1 Attachment(s)
Re: [2008] Get part of background image covered by ListView control
Obi..I think I have this solved.
It did require adding the 3rd option like you did to set a custom background source. Once that was done, I had to code a loop to calculate the x/y coordinates of the control in relation to n levels down of parents to get to the control that is assigned as the CustomContainer.
So you may also want to add some error handling to the setter of the CustomContainer to ensure that when someone sets that property, they are only allowed to set it to a control that is actually a container to the control you are making transparent. Otherwise it will likely hit an infinite loop when trying to calculate the x/y (since it loops back each parent until the one you specified is hit)
Anyway, here is a test project with the modified code in it, and you can see I tried both vertical and horizontal split containers on top of panels with the bg image, and it looks to me to be working fine.
Re: [2008] Get part of background image covered by ListView control
When I set a very small image stretched over the panel (the image was 7x7 pixels, created in Paint), the colors are a little off, other than that it works like a charm :) Since I won't be using such a small image, the modifications are perfect for me :)
Thanks a lot. Your help is much appreciated. Unfortunately, the forum states that I'm supposed to spread some rep around before giving it to you again :S
Re: [2008] Get part of background image covered by ListView control
I'm just glad it is working for you.
Colors could be off on a 7x7 pixel image just due to the stretching... anything of a larger acceptible size should work just fine.
Re: [2008] Get part of background image covered by ListView control
I finally finished the control and posted it in the CodeBank:
http://www.vbforums.com/showthread.p...93#post3693493
Kleinma, thank you for all your help :) It was a pleasure :)
Cheers :)