for the code which helped the proverbial light bulb come on as pertains to API
calls (a first for me). Maybe one day I'll be able to return the favor by helping
someone else out. Thanks again for the help guys.
Wesley

------------------
#Compile Exe #Register None #Dim All #Include "Win32Api.Inc" %ID_FRAME = 100 %ID_Label1 = 101 %ID_Label2 = 102 %ID_Text1 = 201 %ID_TEXT2 = 202 %ID_Button = 301 Function MakeFont(Font As Asciiz, Charset As Long, Bold As Long, Italic As Long, PointSize As Long) As Long Local hDC As Long Local CyPixels As Long hDC = GetDC(%HWND_DESKTOP) CyPixels = GetDeviceCaps(hDC, %LOGPIXELSY) ReleaseDC %HWND_DESKTOP, hDC Function = CreateFont(MulDiv(PointSize, CyPixels, 72), 0, 0, 0, Bold, Italic, 0, 0, _ CharSet, %OUT_TT_PRECIS, %CLIP_DEFAULT_PRECIS, %DEFAULT_QUALITY, %FF_DONTCARE, Font) End Function CallBack Function hDlg_CB() Dim hFont1 As Long, hFont2 As Long Dim BrushLtBr As Static Long, BrushWhite As Static Long, BrushBlue As Static Long Select Case CbMsg Case %WM_INITDIALOG BrushLtBr = CreateSolidBrush (&H80C0FF) BrushWhite = CreateSolidBrush (%White) BrushBlue = CreateSolidBrush (%Blue) hFont1 = MakeFont ("Times New Roman", %ANSI_CHARSET, %FW_BOLD, %False, 12) Control Send CbHndl, %ID_TEXT1, %WM_SETFONT, hFont1, 0 hFont2 = MakeFont ("Courier New", %ANSI_CHARSET, %FW_NORMAL, %True, 16) Control Send CbHndl, %ID_TEXT2, %WM_SETFONT, hFont2, 0 Case %WM_DESTROY DeleteObject BrushLtBr DeleteObject BrushWhite DeleteObject BrushBlue DeleteObject hFont1 DeleteObject hFont2 Case %WM_CTLCOLORDLG Function = BrushLtBr Case %WM_CTLCOLORSTATIC, %WM_CTLCOLOREDIT Select Case GetDlgCtrlId(CbLparam) Case %ID_Text1 SetTextColor CbWparam, %Blue SetBkColor CbWparam, %White Function = BrushWhite Case %ID_TEXT2 SetTextColor CbWparam, %White SetBkColor CbWparam, %Blue Function = BrushBlue Case %ID_Label1, %ID_FRAME SetBkMode CbWparam, %TRANSPARENT SetTextColor CbWparam, &H80 Function = BrushLtBr Case %ID_Label2 SetTextColor CbWparam, %White SetBkColor CbWparam, %Blue Function = BrushBlue Case %ID_BUTTON SetBkColor CbWparam, &H80C0FF SetTextColor CbWparam, %Blue Function = BrushLtBr End Select End Select End Function Function PbMain Local hDlg As Long Dialog New %HWND_DESKTOP,"Test", , , 300, 250, %WS_CAPTION Or %WS_SYSMENU To hDlg Control Add Label, hDlg, %ID_Label1, "Transparent", 10, 5, 280, 10, %SS_RIGHT Control Add Frame, hDlg, %ID_FRAME, " Frame ", 5, 20, 290, 225 Control Add TextBox, hDlg, %ID_Text1, "", 15, 35, 270, 80, %ES_WANTRETURN Or %ES_MULTILINE Or %WS_TABSTOP, %WS_EX_CLIENTEDGE Control Add TextBox, hDlg, %ID_Text2, "Multiline" + $CRLF + "Readonly" + $CRLF + "Try to change", 15, 150, 270, 80, %ES_WANTRETURN Or %ES_MULTILINE Or %ES_READONLY, %WS_EX_CLIENTEDGE Control Add Option, hDlg, %ID_Button, "Testbutton", 40, 120, 80, 15 Dialog Show Modal hDlg, Call hDlg_CB End Function
If you look at the description of window-styles for the text-box you will notice that you either do not enter anything, to get the default style or you have to include at least %WS_CHILD or %WS_VISIBLE This is the default (according to documentation) for textboxes Textbox %WS_TABSTOP, %WS_BORDER, 50810080 %ES_AUTOHSCROLL so why not try Control Add TextBox, hDlg, %MesgBox, "", 130, 15, 320, 15,50810080 or %ES_READONLY
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: