h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Enable/Disable date at runtime in DateTime in .Net


Today we will discuss about how to enable and disable date at runtime in DateTime in .Net Drag and Drop DateTimepicker to form. Change in the DatetimePicker:Checked: true
S.NoPro NameModify
1CustomFormatdd/MM/yyyy
2FormatCustom
3ShowCheckBoxTRUE
Run the Application 
unchecked the Check box on the DatetimePicker.
date will disable in the DatetimePicker.

checked  the Check box on the DatetimePicker.
date will enable in the DatetimePicker.

Percentage Validation and Calculation in VB.net

Today , we discussed about Percentage Validation in VB.Net
Dim RegExpression As Regex
Dim RegExpression1 As Regex
RegExpression = New Regex("^((100.00)|([1-9][0-9]|[1-9]|)(\.\d\d))$")
RegExpression1 = New Regex("^((100)|([1-9][0-9]|[1-9]|))$")
If RegExpression.IsMatch(TextBox3.Text) Or RegExpression1.IsMatch(TextBox3.Text) Then
If TextBox3.Text <> "" Then
Dim Dec As Double = CDbl(TextBox1.Text) * CDbl(TextBox3.Text) / 100
Dec = Math.Round(CDbl(Dec), 2, MidpointRounding.ToEven)
TextBox2.Text = Dec.ToString()
Dim result As Double = Math.Round(Dec, 0, MidpointRounding.AwayFromZero)
TextBox4.Text = result.ToString()
End If
Else
MsgBox("Not a match!")
TextBox3.Text = ""
TextBox3.Focus()
End If