Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27412

VS 2010 Error in VB!

$
0
0
Guys, i need your helps!
I'm a newbie in VB language. I have a code with an error which i can't resolve it:
Code:

Private Sub UserForm_Initialize()
      If Weekday(Of Date)() = 1 Then Scrl_Неделя.Value = 7 Else _
            Scrl_Неделя.Value = Weekday(Of Date)() - 1
        Txt_Обычный.Text = 0
        Txt_Оптовый.Text = 5
        Txt_Льготный.Text = 10
        TxtПорог.Text = 100
        TxtПн.Text = 0
        TxtВт.Text = 1
        TxtСр.Text = 2
        TxtЧт.Text = 3
        TxtПт.Text = 4
        TxtСб.Text = 5
        TxtВс.Text = 6
        TxtСкидка1.Text = 2
        Dim DtmSegodnya As Date
        Dim DtmSejchas As Date
        DtmSegodnya = Date
        DtmSejchas = Timer
        TxtДата.Text = FormatDateTime(DtmSegodnya, vbShortDate)
        TxtВремя.Text = FormatDateTime(DtmSejchas, vbLongTime)
    End Sub

This code give an error from this lines:
Code:

If Weekday(Of Date)() = 1 Then Scrl_Неделя.Value = 7 Else _
            Scrl_Неделя.Value = Weekday(Of Date)() - 1

Quote:

Public Function Weekday(DateValue As Date, [DayOfWeek As Microsoft.VisualBasic.FirstDayOfWeek = FirstDayOfWeek.Sunday]) As Integer' has no type parameters and so cannot have type arguments.
And this lines:
Code:

DtmSegodnya = Date
        DtmSejchas = Timer

Quote:

'Date' is a type and cannot be used as an expression
'.' expected.
'Timer' is a type and cannot be used as an expression
Help me guys pls!
And sry for my bad english if you guys can't understand some place!

Viewing all articles
Browse latest Browse all 27412

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>