VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code allows you to put the begin and end dates in two separate textboxes as you drag your mous

by L Tropa (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 25th January 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code allows you to put the begin and end dates in two separate textboxes as you drag your mouse over MonthView1 Control. Good for date

Rate This code allows you to put the begin and end dates in two separate textboxes as you drag your mous




'This code needs a Form with 1 MonthView and 2 textboxes controls  called "txtDataInicio1Per" and "txtDataFim1Per" and a Module for variable declaration if you want it to be used in your entire application
'just paste it into your Form and be sure to have the controls i mencioned

dim N

On Error Resume Next

'You can change the names of the Variables "PrimeiraData" and "SegundaData" to your own; they are declared Public (as Date) at Module level or in the declaration part of your Form depending on what use you want to give them

Primeiradata = MonthView1.SelStart 'This Variable returns the date where the mouse first clicks
SegundaData = MonthView1.SelEnd 'This Variable returns the last date (where the mouse is released)

For N = PrimeiraData To SegundaData
               
        If Weekday(DateValue(N)) = vbSunday Or Weekday(DateValue(N)) = Saturday 
        then        
        exit sub
Else
        txtDataInicio1Per = MonthView1.SelStart
        txtDataFim1Per.Text = N
        End If
    
Next N

End Sub

Download this snippet    Add to My Saved Code

This code allows you to put the begin and end dates in two separate textboxes as you drag your mous Comments

No comments have been posted about This code allows you to put the begin and end dates in two separate textboxes as you drag your mous. Why not be the first to post a comment about This code allows you to put the begin and end dates in two separate textboxes as you drag your mous.

Post your comment

Subject:
Message:
0/1000 characters