สามารถใช้ CODE ตามนี้ได้เลยครับ
Table of Contents
Code สำหรับ VB6
- Code สำหรับ VB6
If Val(Format(Now, "YYYY")) = Year(Now) Then MsgBox "Regional Setting = English, Year type is A.D.(Anno Domini) or คริสต์ศักราช(ค.ศ.)" Else MsgBox "Regional Setting = Thai, Year type is B.E.(Buddhist Era) or พุทธศักราช(พ.ศ.)" End If
Code สำหรับ VB.NET
- สังเกตุว่าตรง Now เหมือนกัน หรือ ใช้ตัว
เพิ่มเข้าไป ^___^Date.Now
If Val(Format(Date.Now, "YYYY")) = Year(Now) Then MsgBox "Regional Setting = English, Year type is A.D.(Anno Domini) or คริสต์ศักราช(ค.ศ.)" Else MsgBox "Regional Setting = Thai, Year type is B.E.(Buddhist Era) or พุทธศักราช(พ.ศ.)" End If
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.