web development India freelance website designer
'Add 1 Command Button and 3 Text Boxes to your form.
'Set Text1 MultiLine Property to True.
'At Run-Time, insert the Text Box left margin to Text2, and the right margin to Text3,
'and press the button to apply the changes.
'Insert the following code to your form:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal _
lParam As Long) As Long
Private Const EM_SETMARGINS = &HD3
Private Const EC_LEFTMARGIN = &H1
Private Const EC_RIGHTMARGIN = &H2

Private Sub Command1_Click()
SetMargins
End Sub

Private Sub Form_Load()
Text2 = "30"
Text3 = "30"
SetMargins
Text1.Text = "This program shows how to set the left and right margins _
of a TextBox." & vbCrLf & " Its been taken from Go.to/vbhelp"
End Sub

Private Sub SetMargins()
Dim left_margin As Integer
Dim right_margin As Integer
Dim long_value As Long
left_margin = CInt(Text2.Text)
right_margin = CInt(Text3.Text)
long_value = left_margin * &H10000 + right_margin
SendMessage Text1.hwnd, _
EM_SETMARGINS, _
EC_LEFTMARGIN Or EC_RIGHTMARGIN, _
long_value
End Sub


Set Text Box Right And Left Margins

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