In this posting I'll write a sample program of VB6 that demonstrates how to set object properties at run time. However some of property must be set at design time. Okay, follow below instructions:
Your design maybe look like the image on the top of this posting.
'setting Form1 caption Form1.Caption = "New Member's Registration Form" 'setting the properties of Title (Label1) With Label1 .Caption = "New Member's Registration Form" .FontSize = 18 .FontUnderline = True .Left = 360 .Top = 120 .Width = 5775 .Height = 495 End With 'setting the properties of Full Name label (Label2) With Label2 .Caption = "Full Name" .FontSize = 10 .Top = 960 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of Gender label (Label3) With Label3 .Caption = "Gender" .FontSize = 10 .Top = 1320 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of Address1 label (Label4) With Label4 .Caption = "Adress1" .FontSize = 10 .Top = 1680 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of Address2 label (Label5) With Label5 .Caption = "Adress2" .FontSize = 10 .Top = 2040 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of City label (Label6) With Label6 .Caption = "City" .FontSize = 10 .Top = 2400 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of Province label (Label7) With Label7 .Caption = "Province" .FontSize = 10 .Top = 2760 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of Country label (Label8) With Label8 .Caption = "Country" .FontSize = 10 .Top = 3120 .Left = 480 .Height = 375 .Width = 1215 End With 'setting the properties of txtFName TextBox With txtFName .Text = "" .FontSize = 10 .Top = 960 .Left = 1680 .Height = 330 .Width = 4335 End With 'setting the properties of cboGender ComboBox With cboGender .Text = "" .FontSize = 10 .Top = 1320 .Left = 1680 ' .Height = 330 .Width = 1575 .AddItem "Female" .AddItem "Male" End With 'setting the properties of txtAddr1 TextBox With txtAddr1 .Text = "" .FontSize = 10 .Top = 1680 .Left = 1680 .Height = 330 .Width = 4335 End With 'setting the properties of txtAddr2 TextBox With txtAddr2 .Text = "" .FontSize = 10 .Top = 2040 .Left = 1680 .Height = 330 .Width = 4335 End With 'setting the properties of txtCity TextBox With txtCity .Text = "" .FontSize = 10 .Top = 2400 .Left = 1680 .Height = 330 .Width = 4335 End With 'setting the properties of txtProvince TextBox With txtProvince .Text = "" .FontSize = 10 .Top = 2760 .Left = 1680 .Height = 330 .Width = 4335 End With 'setting the properties of txtCountry TextBox With txtCountry .Text = "" .FontSize = 10 .Top = 3120 .Left = 1680 .Height = 330 .Width = 4335 End With 'setting the properties of cmdRegister CommandButton With cmdRegister .Caption = "Register" .FontSize = 14 .Top = 3720 .Left = 2880 .Height = 495 .Width = 1695 End With
Your program should like below screenshot.
1 comments:
it's nice blog content and nice creation greeting ,I hope always happy ,health and
sucees for you and GBU
Post a Comment