Print Page | Close Window

Label: MouseIcon e MouseCursor missing!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=18340
Printed Date: 07 May 2024 at 6:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Label: MouseIcon e MouseCursor missing!
Posted By: gibra
Subject: Label: MouseIcon e MouseCursor missing!
Date Posted: 08 May 2011 at 8:04am

I want to use a Label as a link (i.e. http:// http://www.google.com - 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



Replies:
Posted By: jpbro
Date 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, " http://www.google.com - www.google.com "
   SetLabelLink Me.Label2, " http://www.yahoo.com - 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



Posted By: gibra
Date 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


Posted By: jpbro
Date 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



Posted By: gibra
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net