Need a nice versatile container |
Post Reply |
Author | |
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
Posted: 16 May 2009 at 1:26am |
I need a container control that allows me to do this:
It needs rounded corners and a built-in drop-shadow property. The text can either be labels placed inside the container - or the container would have a Caption property that use the markup language and allow multiple lines (\par).
Is this possible with any of the CJ controls right now? If not, is this being worked on? If you could add this type of container control, I would gladly pay an upgrade fee...
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
You could do this with markup...the lines between items might be a bit tricky to calculate, but it could be done. Here's a basic example that fulfils the following:
1) Multiple lines via word wrap or line-breaks 2) Rounded corners 3) Drop shadow Screenshot: Here's the markup that you can add to a Label (with EnableMarkup = True set) or MarkupLabel control:
If you are using the MarkupLabel control, you can use the markup objects to create a set of reusable classes...check out my chart example for how this could work. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Forgot to mention, that the one thing it doesn't fulfil is the container requirement...do you need the control to act as a container for other controls, or was that requirement based on the need for dropping labels into it?
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
|
Wow, that's great. I am going to have to learn to use markup...
I still think a container control with all these properties would be really nice. For now I will play around with your sample.
Thanks for taking the time to put it together.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
You can create your own control with all of the properties/features that you need. I've put together an example using the MarkupLabel objects instead of (hard to work with) XAML strings:
uploads/20090517_114527_AdvancedLabel.zip It's incomplete, but should give you a good starting point. Try it out, and if you have any questions, please get back to me. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
|
The AdvancedLabel has almost everything I need... almost.
Is there a way to change the main background color of the label from white to something else? I need to be able to change the fill color of each label depending on the family line they are in.
Also, I need to put a graphic in the upper-right corner to indicate a link to another database.
This graphic needs to be click-able so that I can head off and do something when they click it.
Any help on this would be greatly appreciated.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
|
This would be really easy if CJ would just add rounded corners and shadow to the Resizer control. Then I could drop in anything I wanted. (And while you are at it, add rounded corners, shadow, and a border to the ShortcutCaption control.)
This would make excellent controls Xtremely excellent...
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Dave,
You can change the background colour of the label area as follows:
Where X is the colour (or system colour) that you want to use. Unfortunately, the Image object is broken in the current release of the MarkupLabel, so we'll have to wait for the next version to add that feature. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
|
In VB6: If I have an AdvancedLabel1 on a form, what would the actual code be to change the background of it to &HFFC0C0 ?
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
|
The more I work with this AdvancedLabel control, the more it seems to be missing.
Looking at the events, there is a GotFocus and LostFocus (which seems very strange for a label-type control), but there is no Click or DblClick or MouseDown or MouseMove or MouseUp.
I need to be able to use Click, DblClick, and MouseMove at a minimum. Is there any way to do this?
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
The project I sent you was a basic demo to illustrate how your initial requirements could be implemented using the MarkupLabel control. I'm a bit busy with my own work right now to write the project for you, but you can add the events you require to the supplied usercontrol and fire them using the RaiseEvents method whenever appropriate. As for the colour, the VB6 code is as I supplied (you can wrap this code in a property in the UserControl and the call the property from your parent form just like any other property. See the BackColor property in the UserControl code for an example).
Unfortunately, it doesn't look like the MarkupLabel supports Click, DblClick or MouseMove so you would have to implement a handler on the constituent markup objects...See this post for more information on implementing events for markup objects. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
I had a chance to try out a few more things with the MarkupLabel control.
MouseMove & Click events were fairly straight forward, although getting the cursor position required API calls. DblClick proves to be more elusive. The MarkupLabel doesn't expose a DblClick handler, so you would have to calculate the time between clicks and register a double-click if they were close enough together. This is enough of a pain in the butt that I don't feel like doing it. Here's the latest sample though (also adds PageColor property): uploads/20090519_170904_AdvancedLabel.zip Some questions for Codejock: 1) Is the MarkupLabel a windowless control, or is the Hwnd property just not exposed? If we could have access to the Hwnd property for subclassing, that would very useful. 2) Any chance of adding a MouseDblClick event handler for all of the markup objects? 3) Any chance of having access to the Mouse coordinates in the appropriate scalemode units without having to resort to API calls? 4) Any chance of control level Mouse events for the MarkupLabel control (MouseMove, MouseUp, MouseDown, Click, DblClick, etc...) rather than having to resort to markup object level handlers? Thanks in advance for any answers to the above questions. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
DaveB
Groupie Joined: 13 March 2009 Status: Offline Points: 52 |
Post Options
Thanks(0)
|
Wow, you are amazing. I feel like I should be paying you for this...
I use a Resize control (not to be confused with the CJ Resizer control) that automatically resizes everything in the window as it is stretched larger and smaller. Normally this also adjusts the size of the fonts on the screen but since there is no Font property exposed for the Caption, Subcaption, and Body text, it doesn't change them. Am I correct in assuming that I could use the markup language to change the font attributes on Form_Resize? Or do you have some other magical way to accomplish this?
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Send funds to Account #12345 at my bank
Actually, I'm glad to help a bit with this (as I find time), because I am also interested in the capabilities and limitations of the new markup objects. You do have complete control over the fonts for the MarkupTextBlock objects. In the supplied UserControl, those objects are stored in the mo_Caption, mo_SubCaption and mo_Body object variables, so you can change their Font* properties at any time. Because everything is wrapped in a UserControl, you can create your own public font property/properties to mirror the MarkupTextBlock font properties (FontFamily, FontSize, FontStyle, etc...they aren't identically named to the standard VB font properties), or you can just change the font size in the UserControl_Resize event. My best advice would be to look over the supplied Usercontrol code closely and play around with it to see what results you can get. If you get stumped, get back to me and I will try to help. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
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 |