如题...3Q~~~

解决方案 »

  1.   

    自己写个form,做个传入的参数。就是一个messagebox。
    想做多大都行。
    在www.codeproject.com上有很多人都自己写了这个form。你上去找找。
    把人家的form拉大一点就成了,功能更不必说。
      

  2.   

    MESSAGEBOX本身没有这个属性吗? 我只想调个大小,不需要做其它处理.
      

  3.   

    只能自己写其实自己写很简单的吧写个form继承一下messagebox 不就ok了。
      

  4.   

    因为项目在BUG对应阶段,不好再往工程中添加新窗体.本意是想问问MESSAGEBOX的SHOW方法的重载方法中有没有带可调整大小的方法.
      

  5.   

    不可以,除非你在MessageBox前新建一个线程来FindWindow 
    不过这样做还不如用 DoModal 来显示一个新的对话框 
    INT CBTMessageBox(HWND hwnd, LPSTR lpText, LPSTR lpCaption, 
    UINT uType) 

    hhk = SetWindowsHookEx(WH_CBT, &CBTProc, 0, 
    GetCurrentThreadId()); 
    return MessageBox(hwnd, lpText, lpCaption, uType); 
    } LRESULT CALLBACK CBTProc(INT nCode, WPARAM wParam, LPARAM lParam) 

    HWND hParentWnd, hChildWnd; // msgbox is "child" 
    RECT rParent, rChild, rDesktop; 
    POINT pCenter, pStart; 
    INT nWidth, nHeight; // notification that a window is about to be activated 
    // window handle is wParam 
    if (nCode == HCBT_ACTIVATE) 

    // set window handles 
    hParentWnd = GetForegroundWindow(); 
    hChildWnd = (HWND)wParam; if((hParentWnd != 0) && 
    (hChildWnd != 0) && 
    (GetWindowRect(GetDesktopWindow(), &rDesktop) != 0) && 
    (GetWindowRect(hParentWnd, &rParent) != 0) && 
    (GetWindowRect(hChildWnd, &rChild) != 0)) 

    // calculate message box dimensions 
    nWidth = (rChild.right - rChild.left); 
    nHeight = (rChild.bottom - rChild.top); // calculate parent window center point 
    pCenter.x = rParent.left+((rParent.right 
    - rParent.left)/2); 
    pCenter.y = rParent.top+((rParent.bottom 
    - rParent.top)/2); // calculate message box starting point 
    pStart.x = (pCenter.x - (nWidth/2)); 
    pStart.y = (pCenter.y - (nHeight/2)); // adjust if message box is off desktop 
    if(pStart.x < 0) pStart.x = 0; 
    if(pStart.y < 0) pStart.y = 0; 
    if(pStart.x + nWidth > rDesktop.right) 
    pStart.x = rDesktop.right - nWidth; 
    if(pStart.y + nHeight > rDesktop.bottom) 
    pStart.y = rDesktop.bottom - nHeight; // move message box 
    MoveWindow(hChildWnd, 
    pStart.x, pStart.y, 
    nWidth, nHeight, 
    FALSE); 

    // exit CBT hook 
    UnhookWindowsHookEx(hhk); 

    // otherwise, continue with any possible chained hooks 
    else CallNextHookEx(hhk, nCode, wParam, lParam); 
    return 0; 
    } 哈哈,那你自己form多容易呀
      

  6.   

    最经典的答案!:
    MessageBox.Show("                                                     输入你要弹出的内容                                                                   ");看看!
    弹出的窗口是不是很大呀!!
      

  7.   

    MessageBox 会根据内容自动缩放,需要变大 可以增加行 .