|
-
Aug 12th, 2010, 01:52 AM
#1
Thread Starter
Lively Member
AutoSize as like Label
Hello all,
AutoSize property of label all we know. This makes the width of label expand as per the contents.
I am using a 3rd party activex control which is drawn on image as annotation. This control returns its bounds in bitmap coordinates and can be set as well like that. The basic problem i am facing is to Set its width according to length of text which is set in it and also when to set it according to different font set and font sizes.
Any ideas how to implement the AutoSize functionality for such use.
For now temporary workaround I have done is to set the content to a label which is autosized, and then by converting the width of label to bitmap coordinates and then set it to the annotation activex. But still its not working perfectly.
Regds,
-
Aug 12th, 2010, 02:56 AM
#2
Re: AutoSize as like Label
I'm suprised the approach using the Label will not work, I should recheck your code for that.
Alternatively use of the GetTextExtentPoint32 API Function may be of interest;
http://msdn.microsoft.com/en-us/libr...38(VS.85).aspx
http://tek-tips.com/viewthread.cfm?qid=1036091
-
Aug 12th, 2010, 03:04 AM
#3
Addicted Member
Re: AutoSize as like Label
Hi,
Why the " Autosized Label" workaround not working...? Before getting the width of label, have you set the Fontname/Size ....?
Regards
Veena
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|