فارسي كردن صفحه كليد در vb

baghaei

عضو جدید
دوستان عزيز سلام . آيا كسي مي تواند به من كمك كند تا در يك فيلد بتوانم فارسي تايپ كنم لطفا توابع و رويه هاي آن را بنويسيد
 

yasin_d

عضو جدید
کاربر ممتاز
منظورت رو خوب متوجه نشدم .
یعنی توی یه textbox فارسی بنویسی بدون اینکه Alt+Shift رو بزنی یا چیز دیگه.
اگه منظورت این بود که باید از امکان bidimode استفاده کنی که توی دلفی با این دستور هست
کد:
Application.BiDiKeyboard:='00000429';
توی vb هم همچین دستوری به طور مشابه هست الان یادم نمیاد
 

mehrnoosh13

عضو جدید
منظورت رو خوب متوجه نشدم .
یعنی توی یه textbox فارسی بنویسی بدون اینکه Alt+Shift رو بزنی یا چیز دیگه.
اگه منظورت این بود که باید از امکان bidimode استفاده کنی که توی دلفی با این دستور هست
کد:
Application.BiDiKeyboard:='00000429';
توی vb هم همچین دستوری به طور مشابه هست الان یادم نمیاد
نه منظورشو من می فهمم منم همین مشکلو دارم یعنی alt وshift هم که بگیرم نمیشه داخل textbox فارسی نوشت.
 

lordhamed

عضو جدید
lordhamed

lordhamed

نه منظورشو من می فهمم منم همین مشکلو دارم یعنی alt وshift هم که بگیرم نمیشه داخل textbox فارسی نوشت.


شاید از فونت textbox هستش . از قسمت فونتش فونت عوض کن دروست میشه .
اینم قابل توجه مدیر تالار ::::
Public Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
شما اين تعريف رو تو قسمت اعلانات معرفي كنيد
بعد هم وقتي كه كنترل به جعبه متن مي رسه با فرا خواني تابع زير صفحه كليد فارسي ميشه و نيازي به زدنAlt + Shift نيست
1, "00000429" LoadKeyboardLayout با اين فرا خواني فارسي ميشه

1, "00000409" LoadKeyboardLayout با اين فرا خواني انگليسي ميشه
 

اميد200

عضو جدید
شاید از فونت textbox هستش . از قسمت فونتش فونت عوض کن دروست میشه .
اینم قابل توجه مدیر تالار ::::
Public Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
شما اين تعريف رو تو قسمت اعلانات معرفي كنيد
بعد هم وقتي كه كنترل به جعبه متن مي رسه با فرا خواني تابع زير صفحه كليد فارسي ميشه و نيازي به زدنAlt + Shift نيست
1, "00000429" LoadKeyboardLayout با اين فرا خواني فارسي ميشه

1, "00000409" LoadKeyboardLayout با اين فرا خواني انگليسي ميشه
برنامه را اجراء كردم- اجرا نشد و پيام ميدهد:
there is no entry point in lib user32

لطفا مرا راهنمايي كنيد
 

rezaelmi

عضو جدید
Public Function SetKeyFarsi() As Integer
Dim Retval As Long
' Retval = ActivateKeyboardLayout(67175425, 1) 'Win 98
Retval = ActivateKeyboardLayout(69796905, 1) 'win2000
End Function
 

girgirak777

عضو جدید
فارسی نویسی در ویژوال بیسیک بدون تغییر زبان کیبورد

برای اینکه بتوانیم در یک تکست باکس فارسی تایپ کنیم آن هم بدون تغییر زبان کیبورد با چند خط کد زیر می توانید این کار را انجام دهید
برای این کار ابتدا یک تکست باکس در فرم ایجاد کنید و سپس یک text box ایجاد کنید
نام این تکست باکس text1 بگذارید
در رویه keypress این تکست باکس کد زیر را بنویسید
با این کار بدون توجه به زبان کیبورد (به هر زبانی که باشد) فارسی نوشته می شود.
[FONT=courier new, courier, mono]Private Sub Text1_KeyPress(KeyAscii As Integer)[/FONT]
[FONT=courier new, courier, mono]On Error Resume Next[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 104 Then KeyAscii = -57[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 72 Then KeyAscii = -62[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 102 Then KeyAscii = -56[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 113 Then KeyAscii = -42[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 119 Then KeyAscii = -43[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 101 Then KeyAscii = -53[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 114 Then KeyAscii = -34[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 121 Then KeyAscii = -37[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 117 Then KeyAscii = -38[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 111 Then KeyAscii = -50[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 112 Then KeyAscii = -51[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 105 Then KeyAscii = -27[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 116 Then KeyAscii = -35[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 91 Then KeyAscii = -52[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 93 Then KeyAscii = -115[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 92 Then KeyAscii = -114[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 96 Then KeyAscii = -127[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 97 Then KeyAscii = -44[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 115 Then KeyAscii = -45[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 100 Then KeyAscii = -19[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 103 Then KeyAscii = -31[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 106 Then KeyAscii = -54[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 107 Then KeyAscii = -28[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 108 Then KeyAscii = -29[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 59 Then KeyAscii = -33[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 39 Then KeyAscii = -112[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 122 Then KeyAscii = -39[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 120 Then KeyAscii = -40[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 99 Then KeyAscii = -46[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 118 Then KeyAscii = -47[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 98 Then KeyAscii = -48[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 110 Then KeyAscii = -49[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 109 Then KeyAscii = -63[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 44 Then KeyAscii = -26[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 63 Then KeyAscii = 191[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 77 Then KeyAscii = -58[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 48 Then KeyAscii = 16[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 49 Then KeyAscii = 17[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 50 Then KeyAscii = 18[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 51 Then KeyAscii = 19[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 52 Then KeyAscii = 20[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 53 Then KeyAscii = 21[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 54 Then KeyAscii = 22[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 55 Then KeyAscii = 23[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 56 Then KeyAscii = 24[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 57 Then KeyAscii = 25[/FONT]
[FONT=courier new, courier, mono]If KeyAscii = 58 Then KeyAscii = 26[/FONT]
[FONT=courier new, courier, mono]End Sub[/FONT]

http://kojoor.blogfa.com/post-48.aspx
 
بالا