dcsimg
Page 2 of 2 FirstFirst 12
Results 41 to 49 of 49

Thread: [RESOLVED] Rotate Label by 90 Degrees

  1. #41

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,948

    Re: [RESOLVED] Rotate Label by 90 Degrees

    @Trick: WOW, that's some nice work, but I wasn't sure I wanted to fire up the GDI+ for this thing.

    @Wqweto: Hmm, I tried making every change you recommended (the green lines on your link), and I'm still getting the same results, no text. If it's working for you, could you please zip and attach a demo project? Thanks.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #42

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,948

    Re: [RESOLVED] Rotate Label by 90 Degrees

    @Wqweto: Ok, hold on. I just backed up and grabbed the full module you posted, and it's working. Let me play with it.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  3. #43

  4. #44
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,683

    Re: [RESOLVED] Rotate Label by 90 Degrees

    Quote Originally Posted by The trick View Post
    You can use NO GDI+ it just shows how to create semi-transparent windowless-UC and you just can write your own text.
    Yes, this is your sample control that inspired me to research transparent windowless controls for a project of mine at somewhat more depth and with great success.

    I just edited a summary of the tweaks that one has to do at the design-time properties and code adjustments for the paint event in my previous post.

    cheers,
    </wqw>

  5. #45
    Frenzied Member
    Join Date
    Feb 2015
    Posts
    1,434

    Re: [RESOLVED] Rotate Label by 90 Degrees

    Yes, this is your sample control that inspired me to research transparent windowless controls for a project of mine at somewhat more depth and with great success.
    Yes i saw this nice project. I try to use windowless controls as much as possible in my project because it's more flexible.

    BTW, i also made the transparent windowed controls but that's more complicated and as far i remember not always redraws background if a background control moves behind other.

    ADDED.
    BTW, i suggested in the #20 post to implement the vertical IFont object. I tested and it won't work properly because the text always starts at the upper left corner. It draws the text along the needed angle but it's disappears behind the control bounds.

  6. #46
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,683

    Re: [RESOLVED] Rotate Label by 90 Degrees

    10x

    Off topic: You can check out the touch keyboard control in contrib folder too which is a fairly complete implementation of iPad/iPhone touch keyboard, including numbers, case and language switching (with BG cyrillic support) and possible layout switching e.g. numeric only vs full keyboard.



    It uses the free version of Font Awesome for the glyphs and I just published a compiled executable in releases (the zip contains and the font files too).

    cheers,
    </wqw>

  7. #47

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,948

    Re: [RESOLVED] Rotate Label by 90 Degrees

    Okey dokey, it's now working perfectly! Transparent, Windowless, anti-aliased text, Unicode.

    Wqweto, THANK YOU.

    Basically, I'm using exactly what you posted. All I did was delete the BackColor property, because it no longer had any meaning.

    I guess my stumbling block was that I didn't realize that the Transparency and the Windowless were actually linked.

    For posterity, I've attached a small demo project. I'd post the code but there are several UC properties that are necessary. And I'd post the "full" code (markup plus VB6 code), but there's a CTX with a nice rotated A in it (for the toolbox). Wqweto, I gave you some attribution in top-comments. I hope you don't mind.

    I think this thread is now truly resolved, but y'all are certainly willing to discuss other alternatives. I'm a truly happy-camper on this one though. I've already woven it into my primary project, and I can now drag-and-move by these LabelVert controls.

    Best Regards,
    Elroy
    Attached Files Attached Files
    Last edited by Elroy; Mar 7th, 2019 at 02:59 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  8. #48
    Junior Member dseaman's Avatar
    Join Date
    Oct 2004
    Location
    Natal, Brazil
    Posts
    28

    Re: [RESOLVED] Rotate Label by 90 Degrees

    UserControl.TextWidth and UserControl.TextHeight will return incorrect results when string has Unicode content.

    Try this:

    Code:
    Private Type SizeAPI
      cx                  As Long
      cy                  As Long
    End Type
    
    Private Declare Function GetTextExtentPointW Lib "gdi32" (ByVal hdc As Long, ByVal lpszString As Long, ByVal cbString As Long, lpSize As SizeAPI) As Long
    
    Private Function TextWidthW() As Long
      Dim sz    As SizeAPI
      GetTextExtentPointW hdc, StrPtr(msCaption), Len(msCaption), sz
      TextWidthW = sz.cx
    End Function
    
    Private Function TextHeightW() As Long
      Dim sz    As SizeAPI
      GetTextExtentPointW hdc, StrPtr(msCaption), Len(msCaption), sz
      TextHeightW = sz.cy
    End Function

  9. #49

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,948

    Re: [RESOLVED] Rotate Label by 90 Degrees

    Ahhh, good to know, dseaman. For this type of stuff, I actually prefer using API calls anyway. Microsoft says I should use the GetTextExtentPoint32W call, so that's what I did. It's called the same as GetTextExtentPointW.

    I'll incorporate it. I don't think I'll re-post the control though, as others should be able to work this out.

    Again, Thanks,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width