Announcement

Collapse
No announcement yet.

%em_setmargins

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • %em_setmargins

    Has anyone had experience using %EM_SETMARGINS?
    I have tried using all of the following with EZGUI and directly by API:

    %EM_SETMARGINS, %EC_LEFTMARGIN OR EC_RIGHTMARGIN, l&
    %EM_SETMARGINS, %EC_LEFTMARGIN, l&
    %EM_SETMARGINS, %EC_RIGHTMARGIN, l&

    but in the cases where I use %EC_LEFTMARGIN it will only set the left margin and ignores the right margin setting.

    Could someone offer advice?
    Brian.

  • #2
    Here is free code directly from the FireFly Visual Designer function library:

    Code:
    Sub FF_TextBox_SetMargins (ByVal hWndControl As Dword, _
                               ByVal nLeftMargin As Long, _
                               ByVal nRightMargin As Long) 
        
        ' Do a check to ensure that this is actually a window handle
        If IsWindow(hWndControl) Then  
           ' Set the margins
           SendMessage hWndControl, %EM_SETMARGINS, _
                          %EC_LEFTMARGIN Or %EC_RIGHTMARGIN, _
                          MakLng(nLeftMargin, nRightMargin)
        End If  
        
    End Sub
    Paul Squires
    FireFly Visual Designer (for PowerBASIC Windows 10+)
    Version 3 now available.
    http://www.planetsquires.com

    Comment


    • #3
      Thanks Paul, worked well.
      Brian.

      Comment

      Working...
      X