منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : اريد كود اسم الشهر
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم
اريد كود عند اختيار تاريخ يطلق اسم الشهر فى تكست

شكرا لكم

مثال
يناير/2018
اذا كنت تريد جلب الشهر والسنة الحالية للجهاز :


كود :
TextBox1.Text = Date.Now.ToString("yyyy/MMM")

اما اذا كنت تريد إعادة فورمات التاريخ بواسطة تكست بوكس :


كود :
TextBox2.Text = CDate(TextBox2.Text).ToString("yyyy/MMM")
ينقل الموضوع الى القسم المناسب له

تحياتى لك
وتمنياتى لك التوفيق
ويضا
كود :
Textbox1.text=now.month
هذا الكود المطلوب
كود :
   Private Sub ddat_chang()

       txt_year.Text = Format(ddet_date.Value, "yyyy")
       Dim mn As String
       Dim yy As String

       yy = ddet_date.Value.Year

       '1
       If ddet_date.Value.Month = 1 Then
           mn = "يناير -  "
           txt_month.Text = mn + yy
       End If
       '2
       If ddet_date.Value.Month = 2 Then
           mn = "فبراير - "
           txt_month.Text = mn + yy
       End If
       '3
       If ddet_date.Value.Month = 3 Then
           mn = "مارس -"
           txt_month.Text = mn + yy
       End If
       '4
       If ddet_date.Value.Month = 4 Then
           mn = "إبريل -"
           txt_month.Text = mn + yy
       End If
       '5
       If ddet_date.Value.Month = 5 Then
           mn = "مايو -"
           txt_month.Text = mn + yy
       End If
       '6
       If ddet_date.Value.Month = 6 Then
           mn = "يونيو - "
           txt_month.Text = mn + yy
       End If
       '7
       If ddet_date.Value.Month = 7 Then
           mn = "يوليو -"
           txt_month.Text = mn + yy
       End If
       '8
       If ddet_date.Value.Month = 8 Then
           mn = "أغسطس -"
           txt_month.Text = mn + yy
       End If
       '9
       If ddet_date.Value.Month = 9 Then
           mn = "ستمبر -"
           txt_month.Text = mn + yy
       End If

       '10
       If ddet_date.Value.Month = 10 Then
           mn = "أكتوبر -"
           txt_month.Text = mn + yy
       End If
       '11
       If ddet_date.Value.Month = 11 Then
           mn = " نوفمبر -"
           txt_month.Text = mn + yy

       End If
       '12
       If ddet_date.Value.Month = 12 Then
           mn = "ديسمبر -"
           txt_month.Text = mn + yy
       End If

   End Sub