نمایش نتایج 1 تا 7 از 7

نام تاپیک: messagebox فارسی

  1. #1

    Question messagebox فارسی

    یکبار این مطلب رو نوشتم یا پاک شد یا پاکش کردن
    میخوام یه مسیج باکس فارسی درست باشم. با همه member لیستهاش(یعنی در اصل میخوام از مسیج باکس خود وی بی به ارث ببرم). لااقل نقطه شروع رو بگین یا چند تا راهنمائی کوچک بکنین خودم بقیه اش رو انجام میدم. ممنون میشم

  2. #2
    تو سایت جستجو کن

  3. #3
    کاربر دائمی آواتار linux
    تاریخ عضویت
    بهمن 1381
    محل زندگی
    تهران
    پست
    2,313

    ' This Class was develpoted by SomeBody and I change It to this shape!
    'It changes caption of msgbox to persian word
    'Baabak Bakhshayesh
    '1384
    Imports System
    Imports System.Windows.Forms
    Imports System.Runtime.InteropServices
    Imports System.Text
    PublicClass Pmsgbox
    PrivateDelegateFunction CallBack_WinProc(ByVal uMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger) AsInteger
    PrivateDelegateFunction CallBack_EnumWinProc(ByVal hWnd AsInteger, ByVal lParam AsInteger) AsInteger
    <DllImport("user32.dll")> _
    PrivateSharedFunction GetWindowLong(ByVal hwnd AsInteger, ByVal nIndex AsInteger) AsInteger
    EndFunction
    <DllImport("kernel32.dll")> _
    PrivateSharedFunction GetCurrentThreadId() AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction SetWindowsHookEx(ByVal idHook AsInteger, ByVal lpfn As CallBack_WinProc, ByVal hmod AsInteger, ByVal dwThreadId AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction UnhookWindowsHookEx(ByVal hHook AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
    PrivateSharedFunction SetWindowText(ByVal hwnd AsInteger, ByVal lpString AsString) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction EnumChildWindows(ByVal hWndParent AsInteger, ByVal lpEnumFunc As CallBack_EnumWinProc, ByVal lParam AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction GetClassName(ByVal hwnd AsInteger, ByVal lpClassName As StringBuilder, ByVal nMaxCount AsInteger) AsInteger
    EndFunction
    Shared TopCount AsInteger
    Shared ButtonCount AsInteger
    PrivateConst GWL_HINSTANCE AsInteger = (-6)
    PrivateConst HCBT_ACTIVATE AsInteger = 5
    PrivateConst WH_CBT AsInteger = 5
    PrivateShared hHook AsInteger
    Shared strCaption1 AsString = ""
    Shared strCaption2 AsString = ""
    Shared strCaption3 AsString = ""
    SharedFunction ShowMessage(ByVal hParent AsInteger, ByVal Prompt AsString, OptionalByVal Title AsString = "", OptionalByVal buttons As MessageBoxButtons = MessageBoxButtons.OK, _
    OptionalByVal icon As MessageBoxIcon = MessageBoxIcon.None, OptionalByVal DefaultButton As MessageBoxDefaultButton = MessageBoxDefaultButton.Button1, _
    OptionalByVal options As MessageBoxOptions = MessageBoxOptions.RtlReading, OptionalByVal m As MsgBoxStyle = MsgBoxStyle.ApplicationModal) As DialogResult
    '
    Dim hInst AsInteger
    Dim Thread AsInteger
    TopCount = 0
    ButtonCount = 0
    SelectCase buttons
    Case MessageBoxButtons.AbortRetryIgnore
    strCaption1 =
    "رها کردن"
    strCaption2 = "کوشش مجدد"
    strCaption3 = "چشم پوشی"
    Case MessageBoxButtons.OK
    strCaption1 =
    "تایید"
    Case MessageBoxButtons.OKCancel
    strCaption1 =
    "تایید"
    strCaption2 = "لغو"
    Case MessageBoxButtons.RetryCancel
    strCaption1 =
    "کوشش مجدد"
    strCaption2 = "لغو"
    Case MessageBoxButtons.YesNo
    strCaption1 =
    "بله"
    strCaption2 = "خیر"
    Case MessageBoxButtons.YesNoCancel
    strCaption1 =
    "بله"
    strCaption2 = "خیر"
    strCaption3 = "لغو"
    Case MessageBoxButtons.OK
    strCaption1 =
    "تایید"
    EndSelect
    If Title = ""Then Title = Application.ProductName
    Dim myWndProc As CallBack_WinProc = New CallBack_WinProc(AddressOf WinProc)
    hInst = GetWindowLong(hParent, GWL_HINSTANCE)
    Thread = GetCurrentThreadId()
    hHook = SetWindowsHookEx(WH_CBT, myWndProc, hInst, Thread)
    'Return MessageBox.Show(Prompt, Title, buttons, icon, DefaultButton, options )
    Return MsgBox(Prompt, buttons + icon + DefaultButton + MsgBoxStyle.MsgBoxRight + options + m, Title)
    EndFunction
    PrivateSharedFunction WinProc(ByVal uMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger) AsInteger
    Dim myEnumProc As CallBack_EnumWinProc = New CallBack_EnumWinProc(AddressOf EnumWinProc)
    If uMsg = HCBT_ACTIVATE Then
    EnumChildWindows(wParam, myEnumProc, 0)
    UnhookWindowsHookEx(hHook)
    EndIf
    Return 0
    EndFunction
    PrivateSharedFunction EnumWinProc(ByVal hWnd AsInteger, ByVal lParam AsInteger) AsInteger
    Dim strBuffer As StringBuilder = New StringBuilder(256)
    TopCount += 1
    GetClassName(hWnd, strBuffer, strBuffer.Capacity)
    Dim ss AsString = strBuffer.ToString()
    If (ss.ToUpper().StartsWith("BUTTON")) Then
    ButtonCount += 1
    SelectCase ButtonCount
    Case 1
    SetWindowText(hWnd, strCaption1)
    ExitSelect
    Case 2
    SetWindowText(hWnd, strCaption2)
    ExitSelect
    Case 3
    SetWindowText(hWnd, strCaption3)
    ExitSelect
    EndSelect
    EndIf
    Return 1
    EndFunction
    End
    Class
    آخرین ویرایش به وسیله linux : چهارشنبه 28 فروردین 1387 در 21:05 عصر

  4. #4

    نقل قول: messagebox فارسی

    نقل قول نوشته شده توسط linux مشاهده تاپیک

    ' This Class was develpoted by SomeBody and I change It to this shape!
    'It changes caption of msgbox to persian word
    'Baabak Bakhshayesh
    '1384
    Imports System
    Imports System.Windows.Forms
    Imports System.Runtime.InteropServices
    Imports System.Text
    PublicClass Pmsgbox
    PrivateDelegateFunction CallBack_WinProc(ByVal uMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger) AsInteger
    PrivateDelegateFunction CallBack_EnumWinProc(ByVal hWnd AsInteger, ByVal lParam AsInteger) AsInteger
    <DllImport("user32.dll")> _
    PrivateSharedFunction GetWindowLong(ByVal hwnd AsInteger, ByVal nIndex AsInteger) AsInteger
    EndFunction
    <DllImport("kernel32.dll")> _
    PrivateSharedFunction GetCurrentThreadId() AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction SetWindowsHookEx(ByVal idHook AsInteger, ByVal lpfn As CallBack_WinProc, ByVal hmod AsInteger, ByVal dwThreadId AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction UnhookWindowsHookEx(ByVal hHook AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
    PrivateSharedFunction SetWindowText(ByVal hwnd AsInteger, ByVal lpString AsString) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction EnumChildWindows(ByVal hWndParent AsInteger, ByVal lpEnumFunc As CallBack_EnumWinProc, ByVal lParam AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction GetClassName(ByVal hwnd AsInteger, ByVal lpClassName As StringBuilder, ByVal nMaxCount AsInteger) AsInteger
    EndFunction
    Shared TopCount AsInteger
    Shared ButtonCount AsInteger
    PrivateConst GWL_HINSTANCE AsInteger = (-6)
    PrivateConst HCBT_ACTIVATE AsInteger = 5
    PrivateConst WH_CBT AsInteger = 5
    PrivateShared hHook AsInteger
    Shared strCaption1 AsString = ""
    Shared strCaption2 AsString = ""
    Shared strCaption3 AsString = ""
    SharedFunction ShowMessage(ByVal hParent AsInteger, ByVal Prompt AsString, OptionalByVal Title AsString = "", OptionalByVal buttons As MessageBoxButtons = MessageBoxButtons.OK, _
    OptionalByVal icon As MessageBoxIcon = MessageBoxIcon.None, OptionalByVal DefaultButton As MessageBoxDefaultButton = MessageBoxDefaultButton.Button1, _
    OptionalByVal options As MessageBoxOptions = MessageBoxOptions.RtlReading, OptionalByVal m As MsgBoxStyle = MsgBoxStyle.ApplicationModal) As DialogResult
    '
    Dim hInst AsInteger
    Dim Thread AsInteger
    TopCount = 0
    ButtonCount = 0
    SelectCase buttons
    Case MessageBoxButtons.AbortRetryIgnore
    strCaption1 =
    "رها کردن"
    strCaption2 = "کوشش مجدد"
    strCaption3 = "چشم پوشی"
    Case MessageBoxButtons.OK
    strCaption1 =
    "تایید"
    Case MessageBoxButtons.OKCancel
    strCaption1 =
    "تایید"
    strCaption2 = "لغو"
    Case MessageBoxButtons.RetryCancel
    strCaption1 =
    "کوشش مجدد"
    strCaption2 = "لغو"
    Case MessageBoxButtons.YesNo
    strCaption1 =
    "بله"
    strCaption2 = "خیر"
    Case MessageBoxButtons.YesNoCancel
    strCaption1 =
    "بله"
    strCaption2 = "خیر"
    strCaption3 = "لغو"
    Case MessageBoxButtons.OK
    strCaption1 =
    "تایید"
    EndSelect
    If Title = ""Then Title = Application.ProductName
    Dim myWndProc As CallBack_WinProc = New CallBack_WinProc(AddressOf WinProc)
    hInst = GetWindowLong(hParent, GWL_HINSTANCE)
    Thread = GetCurrentThreadId()
    hHook = SetWindowsHookEx(WH_CBT, myWndProc, hInst, Thread)
    'Return MessageBox.Show(Prompt, Title, buttons, icon, DefaultButton, options )
    Return MsgBox(Prompt, buttons + icon + DefaultButton + MsgBoxStyle.MsgBoxRight + options + m, Title)
    EndFunction
    PrivateSharedFunction WinProc(ByVal uMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger) AsInteger
    Dim myEnumProc As CallBack_EnumWinProc = New CallBack_EnumWinProc(AddressOf EnumWinProc)
    If uMsg = HCBT_ACTIVATE Then
    EnumChildWindows(wParam, myEnumProc, 0)
    UnhookWindowsHookEx(hHook)
    EndIf
    Return 0
    EndFunction
    PrivateSharedFunction EnumWinProc(ByVal hWnd AsInteger, ByVal lParam AsInteger) AsInteger
    Dim strBuffer As StringBuilder = New StringBuilder(256)
    TopCount += 1
    GetClassName(hWnd, strBuffer, strBuffer.Capacity)
    Dim ss AsString = strBuffer.ToString()
    If (ss.ToUpper().StartsWith("BUTTON")) Then
    ButtonCount += 1
    SelectCase ButtonCount
    Case 1
    SetWindowText(hWnd, strCaption1)
    ExitSelect
    Case 2
    SetWindowText(hWnd, strCaption2)
    ExitSelect
    Case 3
    SetWindowText(hWnd, strCaption3)
    ExitSelect
    EndSelect
    EndIf
    Return 1
    EndFunction
    End
    Class
    -------------------------------------------------------------
    عالی بود

  5. #5

    نقل قول: messagebox فارسی

    نقل قول نوشته شده توسط linux مشاهده تاپیک

    ' This Class was develpoted by SomeBody and I change It to this shape!
    'It changes caption of msgbox to persian word
    'Baabak Bakhshayesh
    '1384
    Imports System
    Imports System.Windows.Forms
    Imports System.Runtime.InteropServices
    Imports System.Text
    PublicClass Pmsgbox
    PrivateDelegateFunction CallBack_WinProc(ByVal uMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger) AsInteger
    PrivateDelegateFunction CallBack_EnumWinProc(ByVal hWnd AsInteger, ByVal lParam AsInteger) AsInteger
    <DllImport("user32.dll")> _
    PrivateSharedFunction GetWindowLong(ByVal hwnd AsInteger, ByVal nIndex AsInteger) AsInteger
    EndFunction
    <DllImport("kernel32.dll")> _
    PrivateSharedFunction GetCurrentThreadId() AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction SetWindowsHookEx(ByVal idHook AsInteger, ByVal lpfn As CallBack_WinProc, ByVal hmod AsInteger, ByVal dwThreadId AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction UnhookWindowsHookEx(ByVal hHook AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll", CharSet:=CharSet.Auto)> _
    PrivateSharedFunction SetWindowText(ByVal hwnd AsInteger, ByVal lpString AsString) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction EnumChildWindows(ByVal hWndParent AsInteger, ByVal lpEnumFunc As CallBack_EnumWinProc, ByVal lParam AsInteger) AsInteger
    EndFunction
    <DllImport("user32.dll")> _
    PrivateSharedFunction GetClassName(ByVal hwnd AsInteger, ByVal lpClassName As StringBuilder, ByVal nMaxCount AsInteger) AsInteger
    EndFunction
    Shared TopCount AsInteger
    Shared ButtonCount AsInteger
    PrivateConst GWL_HINSTANCE AsInteger = (-6)
    PrivateConst HCBT_ACTIVATE AsInteger = 5
    PrivateConst WH_CBT AsInteger = 5
    PrivateShared hHook AsInteger
    Shared strCaption1 AsString = ""
    Shared strCaption2 AsString = ""
    Shared strCaption3 AsString = ""
    SharedFunction ShowMessage(ByVal hParent AsInteger, ByVal Prompt AsString, OptionalByVal Title AsString = "", OptionalByVal buttons As MessageBoxButtons = MessageBoxButtons.OK, _
    OptionalByVal icon As MessageBoxIcon = MessageBoxIcon.None, OptionalByVal DefaultButton As MessageBoxDefaultButton = MessageBoxDefaultButton.Button1, _
    OptionalByVal options As MessageBoxOptions = MessageBoxOptions.RtlReading, OptionalByVal m As MsgBoxStyle = MsgBoxStyle.ApplicationModal) As DialogResult
    '
    Dim hInst AsInteger
    Dim Thread AsInteger
    TopCount = 0
    ButtonCount = 0
    SelectCase buttons
    Case MessageBoxButtons.AbortRetryIgnore
    strCaption1 =
    "رها کردن"
    strCaption2 = "کوشش مجدد"
    strCaption3 = "چشم پوشی"
    Case MessageBoxButtons.OK
    strCaption1 =
    "تایید"
    Case MessageBoxButtons.OKCancel
    strCaption1 =
    "تایید"
    strCaption2 = "لغو"
    Case MessageBoxButtons.RetryCancel
    strCaption1 =
    "کوشش مجدد"
    strCaption2 = "لغو"
    Case MessageBoxButtons.YesNo
    strCaption1 =
    "بله"
    strCaption2 = "خیر"
    Case MessageBoxButtons.YesNoCancel
    strCaption1 =
    "بله"
    strCaption2 = "خیر"
    strCaption3 = "لغو"
    Case MessageBoxButtons.OK
    strCaption1 =
    "تایید"
    EndSelect
    If Title = ""Then Title = Application.ProductName
    Dim myWndProc As CallBack_WinProc = New CallBack_WinProc(AddressOf WinProc)
    hInst = GetWindowLong(hParent, GWL_HINSTANCE)
    Thread = GetCurrentThreadId()
    hHook = SetWindowsHookEx(WH_CBT, myWndProc, hInst, Thread)
    'Return MessageBox.Show(Prompt, Title, buttons, icon, DefaultButton, options )
    Return MsgBox(Prompt, buttons + icon + DefaultButton + MsgBoxStyle.MsgBoxRight + options + m, Title)
    EndFunction
    PrivateSharedFunction WinProc(ByVal uMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger) AsInteger
    Dim myEnumProc As CallBack_EnumWinProc = New CallBack_EnumWinProc(AddressOf EnumWinProc)
    If uMsg = HCBT_ACTIVATE Then
    EnumChildWindows(wParam, myEnumProc, 0)
    UnhookWindowsHookEx(hHook)
    EndIf
    Return 0
    EndFunction
    PrivateSharedFunction EnumWinProc(ByVal hWnd AsInteger, ByVal lParam AsInteger) AsInteger
    Dim strBuffer As StringBuilder = New StringBuilder(256)
    TopCount += 1
    GetClassName(hWnd, strBuffer, strBuffer.Capacity)
    Dim ss AsString = strBuffer.ToString()
    If (ss.ToUpper().StartsWith("BUTTON")) Then
    ButtonCount += 1
    SelectCase ButtonCount
    Case 1
    SetWindowText(hWnd, strCaption1)
    ExitSelect
    Case 2
    SetWindowText(hWnd, strCaption2)
    ExitSelect
    Case 3
    SetWindowText(hWnd, strCaption3)
    ExitSelect
    EndSelect
    EndIf
    Return 1
    EndFunction
    End
    Class
    ضمن عرض سلام و وقت بخیر خدمت شما دوستان عزیز می خواستم سوال کنم اگر ممکنه بفرمائید این کد ها را کجا می توانم استفاده کنم من در ادیتور فرم قرار دادم و ارور بهم داد ممنون میشم بنده را راهنمایی بفرمائید .
    با تشکر

  6. #6
    کاربر دائمی آواتار swallow.pa
    تاریخ عضویت
    بهمن 1390
    محل زندگی
    توی خونه
    پست
    897

    نقل قول: messagebox فارسی

    نقل قول نوشته شده توسط taha_nadri مشاهده تاپیک
    ضمن عرض سلام و وقت بخیر خدمت شما دوستان عزیز می خواستم سوال کنم اگر ممکنه بفرمائید این کد ها را کجا می توانم استفاده کنم من در ادیتور فرم قرار دادم و ارور بهم داد ممنون میشم بنده را راهنمایی بفرمائید .
    با تشکر
    اينها رو بايد توي يك كلاس بذاري

  7. #7
    کاربر دائمی آواتار az.heidarzadeh
    تاریخ عضویت
    اسفند 1388
    محل زندگی
    Iran-Mashhad
    پست
    241

    نقل قول: messagebox فارسی

    اينم يه نمونه حاضر
    https://barnamenevis.org/attachment.p...8&d=1318407793

تاپیک های مشابه

  1. messagebox در دلفی
    نوشته شده توسط lajevardi106 در بخش برنامه نویسی در Delphi
    پاسخ: 7
    آخرین پست: چهارشنبه 28 تیر 1396, 23:33 عصر
  2. فارسی کردن دکمه های messagebox
    نوشته شده توسط barati_1367 در بخش VB.NET
    پاسخ: 17
    آخرین پست: یک شنبه 02 آذر 1393, 20:21 عصر
  3. Right to Let کردن متن عنوان MessageBox
    نوشته شده توسط babak23 در بخش C#‎‎
    پاسخ: 6
    آخرین پست: جمعه 14 دی 1386, 23:36 عصر
  4. درخواست : یه Messagebox ی میخواهم که کاربر نتونه بیشتر از 7 کاراکتر وارد کنه
    نوشته شده توسط hp1361 در بخش برنامه نویسی در Delphi
    پاسخ: 4
    آخرین پست: سه شنبه 07 شهریور 1385, 18:47 عصر
  5. کلیدهای فارسی برای MessageBox
    نوشته شده توسط once4ever در بخش C#‎‎
    پاسخ: 5
    آخرین پست: جمعه 22 اردیبهشت 1385, 19:44 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •