web development India freelance website designer
'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 = &H20
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOZORDER = &H4
Public Const SWP_FLAGS = SWP_NOZORDER Or SWP_NOSIZE Or _
SWP_NOMOVE Or SWP_DRAWFRAME
Public Const GWL_STYLE = (-16)
Public Const WS_THICKFRAME = &H40000
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public 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 Long

Private Sub Command2_Click()
SetControlStyle initBoxStyle, Text1
End Sub

Private Sub Form_Load()
Command1.Caption = "Start Resizing"
Command2.Caption = "Complete Resizing"
initBoxStyle = GetWindowLong(Text1.hwnd, GWL_STYLE)
SetControlStyle initBoxStyle, Text1
End Sub

Private Sub Form_Unload(Cancel As Integer)
SetControlStyle initBoxStyle, Text1
End Sub

Private Sub Command1_Click()
Dim style As Long
style = GetWindowLong(Text1.hwnd, GWL_STYLE)
style = style Or WS_THICKFRAME
SetControlStyle style, Text1
End Sub

Private Sub SetControlStyle(style, X As Control)
Dim r
If style Then
Call SetWindowLong(X.hwnd, GWL_STYLE, style)
Call SetWindowPos(X.hwnd, Form1.hwnd, 0, 0, 0, 0, SWP_FLAGS)
End If
End Sub


Make A Resizeable Text Box

1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550

Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design