Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - BUG? Label with .Autosize and .Wordwrap
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BUG? Label with .Autosize and .Wordwrap

 Post Reply Post Reply
Author
Message
SeungMina View Drop Down
Groupie
Groupie


Joined: 04 November 2010
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote SeungMina Quote  Post ReplyReply Direct Link To This Post Topic: BUG? Label with .Autosize and .Wordwrap
    Posted: 23 May 2011 at 7:07am
I am using the CodeJock label control with VB6.

With the VB6 intrinsic Label control, I can set a fixed Width so that when Autosize and Wordwrap are set, the control ONLY grows or shrinks VERTICALLY according to the Caption text.

I need the same functionality from the CodeJock Label control, but I can't get it to work.

Setting Autosize and Wordwrap on the CodeJock control results in unpredictable Width and Height of the control when the Caption is changed repeatedly.

This can result in large areas of empty space, and it looks terrible, if any other controls are dynamically repositioned according to changes in the Label's Height (ie. changes to the word-wrapped Caption)

Is this a bug? Or is there a way to make the CJ Label have a fixed width, and only grow/shrink vertically according to the word-wrapping of the Caption?
Back to Top
SeungMina View Drop Down
Groupie
Groupie


Joined: 04 November 2010
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote SeungMina Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2011 at 6:11am
CJ support gave me this workaround:

Label.AutoSize = False
Label.Width=<desired width>
Label.Caption=<new text>
Label.AutoSize = True

This works, although it didn't seem 100% successful unless I reset label height to a single line  (as well as resetting width), before setting a new label caption.

I still consider this a bug though. I expect word-wrapping to behave like a word processor. You expect text in a word processor to wrap at the edge of a page/column ie. at the page/column width that YOU set. Word-wrapped text expands downwards and pages are added/removed depending on the height of the word-wrapped text.

Imagine if your word processor ignored your page/column widths and randomly chose its own position where word-wrapping occurs. CHAOS.

A label with both word wrap and autosize, should not change its width (the place where word-wrapping occurs). And it should only resize vertically, to reveal text that has wrapped, or hide empty lines. Just like a word-processor. And this is exactly what the intrinsic VB6 label control does.

My suggestion is to add a new property to the FlatEdit eg. AutoSizeVerticalOnly. This could default to False, so that any existing applications would be unaffected - but when enabled it would override current AutoSize and deliver the above behaviour.
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.156 seconds.