السلام عليكم
هذا الموضوع استكمال لدورة الاكواد الشاملة
هذا الموضوع خاص بالادوات : اداة TextBox
بيئة العمل : VB.NET 2019 - يعمل على جميع اصدارات VB.NET
============================================
'14-طريقة اخرى للتحكم بلغة ادخال التيكست
كود PHP:
Imports System.Globalization
Public Class Form1
Private Sub EnabledCurrentCulture(ByVal _
sender As Object, ByVal e As EventArgs)
InputLanguage.CurrentInputLanguage = _
InputLanguage.FromCulture(New CultureInfo _
(CultureInfo.CurrentCulture.ToString))
End Sub
Private Sub EnabledEnglishCulture _
(ByVal sender As Object, ByVal e As EventArgs)
InputLanguage.CurrentInputLanguage = _
InputLanguage.FromCulture(New CultureInfo("en"))
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.RightToLeft = _
Windows.Forms.RightToLeft.Yes
AddHandler TextBox1.GotFocus, _
AddressOf EnabledCurrentCulture
Me.TextBox2.RightToLeft = _
Windows.Forms.RightToLeft.No
AddHandler TextBox2.GotFocus, AddressOf _
EnabledEnglishCulture
End Sub
End Class
'14-طريقة اخرى للتحكم بلغة ادخال التيكست
'15-التحكم بلغة التسكت حسب لغة النظام
كود PHP:
Public Class Form1
Enum Language
Arabic
English
End Enum
Private mlanguage As Language
Property LanguageState() As Language
Get
LanguageState = mlanguage
End Get
Set(ByVal Value As Language)
mlanguage = Value
End Set
End Property
Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
Select Case mlanguage
Case Language.Arabic
InputLanguage.CurrentInputLanguage = _
InputLanguage.InstalledInputLanguages(1)
Case Language.English
InputLanguage.CurrentInputLanguage = _
InputLanguage.InstalledInputLanguages(0)
End Select
End Sub
End Class
'15-التحكم بلغة التسكت حسب لغة النظام