VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Useful Active X controls For Better Validations

by Anitha (5 Submissions)
Category: OLE/COM/DCOM/Active-X
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 29th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Useful Active X controls For Better Validations

Rate Useful Active X controls For Better Validations




'MaskEdit Control

'Number Validation
MaskEdBox1.Mask = "9999" 'To allow Numeric Values only & accepts maximum 4 digits only if 4 9's are specified
'Character Validation
MaskEdBox2.Mask = "aaa" 'To allow characters only & accepts maximum 3 characters only if 3 a's are specified
' Date Validation
MaskEdBox3.Format = "dd-mmm-yy" 'Set a Date format as Required
MaskEdBox3.Mask = "99-aaa-99" 'accepts date as 01-jan-99
MaskEdBox1.PromptChar = "^" 'The Prompting characters can be set as per the user's wish
MaskEdBox2.PromptChar = "_"
MaskEdBox3.PromptChar = "*"


'SSTab Control

'the purpose this control is to save the screen space
'More controls cane be placed in each tab of this control.But,dont double click the controls from tool bar,it is better to drag them and place it.
SSTab1.Tabs = 6 'total number of Tabs will be 6
SSTab1.TabsPerRow = 3 'To place 3 tabs per row
'Now if you place 10 textboxes in Tab 1 , they are not visible in next tab.Another set of controls can be placed in the next tab.
SSTab1.TabCaption(1) = "File Maintenance" 'The captions for each tab can be given like this
SSTab1.TabCaption(2) = "Transactions"
SSTab1.TabCaption(3) = "Reports"
'N no.of frames can also be inserted in each tab,which gives some more additional space for the programmer
End Sub


'Calendar control

Private Sub Calendar1_Click()
'Even when it is February 28th,2001 the next day will be correctly indicated as March 1st 2001.
Text1.Text = Calendar1.Value ' To get the current date
Text2.Text = Calendar1.Day & "/" & Calendar1.Month & "/" & Calendar1.Year ' To get the day,month & year separately
Calendar1.NextDay
Text3.Text = Calendar1.Day & "/" & Calendar1.Month & "/" & Calendar1.Year ' To get the next day
End Sub

'Monthview Control

Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Text1.Text = MonthView1.Value ' To get the date clicked by the user
Text2.Text = MonthView1.Day & "-" & MonthView1.Month & "-" & MonthView1.Year 'to get the day , month & year separately
End Sub

'Try and send your comments to [email protected]



Download this snippet    Add to My Saved Code

Useful Active X controls For Better Validations Comments

No comments have been posted about Useful Active X controls For Better Validations. Why not be the first to post a comment about Useful Active X controls For Better Validations.

Post your comment

Subject:
Message:
0/1000 characters