Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Label: MouseIcon e MouseCursor missing!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Label: MouseIcon e MouseCursor missing!

 Post Reply Post Reply
Author
Message
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Topic: Label: MouseIcon e MouseCursor missing!
    Posted: 08 May 2011 at 8:04am

I want to use a Label as a link (i.e. http://www.google.com) and I need show the hand cursor for this label when the mouse is over, as normally happens with any link.

Unfortunately MouseIcon and MouseCursor properties is missing. Ouch
How to?
 
I hope that CJ support add this properties into next release. Wink
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2011 at 9:44am
You can use Markup for this in the meantime - for a demo, put 2 CodeJock labels on a form (Label1 and Label2) and then set the EnableMarkup properties to True in the IDE. The add this code and run:
 

Option Explicit
 
Private Sub Form_Load()
   SetLabelLink Me.Label1, "www.google.com"
   SetLabelLink Me.Label2, "www.yahoo.com"
End Sub
 
Private Sub SetLabelLink(po_Label As XtremeSuiteControls.Label, ByVal p_Url As String)
   If Not po_Label.EnableMarkup Then
      Err.Raise 5, , "Label must have the EnableMarkup property set to TRUE in the IDE in order for link clicking to work!"
   End If
  
   p_Url = Trim$(EncodePlainTextForXaml(p_Url)) ' Make sure we aren't using any characters that will break our XAML parsing
  
   If InStr(1, p_Url, "://") = 0 Then
      ' Make sure we have a protocol in front
      p_Url = "http://" & p_Url
   End If
  
   With po_Label
      ' Add the hyperlink
      .Caption = "<TextBlock><Hyperlink Click='LinkClicked'>" & p_Url & "</Hyperlink></TextBlock>"
      .MarkupContext.SetHandler Me
   End With
End Sub
 
Public Sub LinkClicked(po_Sender As Object, po_Args As Object)
   MsgBox "Navigate to: " & po_Sender.Inlines.Item(0).Text  ' Navigate to the page
End Sub
 
Public Function EncodePlainTextForXaml(ByVal p_PlainText As String) As String
   ' Convert illegal characters to XAML entities
   p_PlainText = Replace$(p_PlainText, "&", "&amp;")
   p_PlainText = Replace$(p_PlainText, "<", "&lt;")
   p_PlainText = Replace$(p_PlainText, ">", "&gt;")
   p_PlainText = Replace$(p_PlainText, "'", "&apos;")
   p_PlainText = Replace$(p_PlainText, """", "&quot;")
  
   ' Expand VB newline characters to XAML <LineBreak/> tags
   p_PlainText = Replace$(p_PlainText, vbNewLine, "<LineBreak/>")
  
   EncodePlainTextForXaml = p_PlainText
End Function
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2011 at 2:57pm
Thank jpbro for your code,
 
but honestly I think that it's very boring re-write tens of code only because CJ doesn't support standard VB controls properties!
As already write on others discussions, CJ controls should be a improvements.
Migrating from a project wich use VB standard controls to the CJ controls should be automatic, and ALL CJ controls should to expose ALL standard VB controls properties. This isn't!
 
In fact, in many cases (as this one) the developer is forced to re-write tens of code, to implement properties that a standard VB.Label where need to set only two properties!
 
About this 'standard' properties I have asked many time ago, but nothing news from CJ support.
Perhaps is too hard to do... Confused
(see your SuiteControls TODO...)
 
Also, the CJ.Label present a paint BUG after changed or resized that cause a bad repaint of control.
 
IMHO
 
 
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2011 at 9:52pm
I didn't know that you were migrating an older project - it is definitely preferable to have all of the same properties, methods, etc... as the intrinsic controls to make this possible/easy. I hoped that once the major work on the Chart control was finished that CJ would revisit a lot of the outstanding issues in the other controls, but other than the ReportControl (on which Andre has been doing great work addressing the big list of old issues), it looks like the rest of the suite is not a high priority :(

Re: the CJ.Label present a paint BUG after changed or resized that cause a bad repaint of control. Do you have a sample to reproduce? I haven't been able to get a bad repaint in my limited test.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 09 May 2011 at 2:59am
Originally posted by jpbro jpbro wrote:

I didn't know that you were migrating an older project - it is definitely preferable to have all of the same properties, methods, etc... as the intrinsic controls to make this possible/easy. I hoped that once the major work on the Chart control was finished that CJ would revisit a lot of the outstanding issues in the other controls, but other than the ReportControl (on which Andre has been doing great work addressing the big list of old issues), it looks like the rest of the suite is not a high priority :(
Yes, unfortunately.
Originally posted by jpbro jpbro wrote:


Re: the CJ.Label present a paint BUG after changed or resized that cause a bad repaint of control.
Do you have a sample to reproduce? I haven't been able to get a bad repaint in my limited test.
I missed to explain that this bug happens at design time, so no project sample need to replicate this bug.
I use Windows7 64bit and WindowsXP Pro SP3 and both o.s. I have the same problem (from CJ v.13.x to v. 15.0.2). See images below :
 
1. In this case the CJ.Label is contained into a GroupBox control.
 
2. in this case CJ.Label is contained into a PictureBox.
 
The problem happens after you extend Label vertically.
In 1st image I have extended 1 time only
In 2nd image I have extended more times.
 
Thank you Smile
 
 
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.