gaby90boy Posted June 27, 2007 Report Share Posted June 27, 2007 'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)'Add 1 Text Box and 2 Command Buttons to your form.'Insert this code to the module :Public Const SWP_DRAWFRAME = &H20Public Const SWP_NOMOVE = &H2Public Const SWP_NOSIZE = &H1Public Const SWP_NOZORDER = &H4Public Const SWP_FLAGS = SWP_NOZORDER Or SWP_NOSIZE Or _SWP_NOMOVE Or SWP_DRAWFRAMEPublic Const GWL_STYLE = (-16)Public Const WS_THICKFRAME = &H40000Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _(ByVal hwnd As Long, ByVal nIndex As Long) As LongPublic Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPublic Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal _hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _ByVal cy As Long, ByVal wFlags As Long) As Long'Insert the following code to your form:Dim initBoxStyle As LongPrivate Sub Command2_Click()SetControlStyle initBoxStyle, Text1End SubPrivate Sub Form_Load()Command1.Caption = "Start Resizing"Command2.Caption = "Complete Resizing"initBoxStyle = GetWindowLong(Text1.hwnd, GWL_STYLE)SetControlStyle initBoxStyle, Text1End SubPrivate Sub Form_Unload(Cancel As Integer)SetControlStyle initBoxStyle, Text1End SubPrivate Sub Command1_Click()Dim style As Longstyle = GetWindowLong(Text1.hwnd, GWL_STYLE)style = style Or WS_THICKFRAMESetControlStyle style, Text1End SubPrivate Sub SetControlStyle(style, X As Control)Dim rIf style ThenCall SetWindowLong(X.hwnd, GWL_STYLE, style)Call SetWindowPos(X.hwnd, Form1.hwnd, 0, 0, 0, 0, SWP_FLAGS)End IfEnd Sub Quote Link to comment Share on other sites More sharing options...