moving a dialog box and making a button a bitmap

This is a discussion on moving a dialog box and making a button a bitmap within the Windows Programming forums, part of the Platform Specific Boards category; How can i make my dialog box so that you can move it no matter where you click on the ...

  1. #1
    Unregistered
    Guest

    moving a dialog box and making a button a bitmap

    How can i make my dialog box so that you can move it no matter where you click on the window
    I also want to no how i can make a button have a bitmap on it

  2. #2
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    http://msdn.microsoft.com/library/de....SetBitmap.asp

    Or if you're using MFC you can use the CBitmapButton class.

  3. #3
    Unregistered
    Guest
    i went to the link and read the stuff but i didnt understand any of it.
    could you give me an example

  4. #4
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Sure.

    Code:
    CButton myButton;
    
    // Create a bitmap button.
    myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_BITMAP, 
       CRect(10,10,60,50), pParentWnd, 1);
    
    // Set the bitmap of the button to be the system check mark bitmap.
    myButton.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );
    Replace MAKEINTRESOURCE(OBM_CHECK)) with the resource ID of the desired bitmap.

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    77
    how to i use the CBitmapButton class to create ??
    any example u can gif mi ?

  6. #6
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Just use CButton with the flag BS_BITMAP.
    CBitmapButton is more complicated and allows for ledd functionality, plus it's MFC specific. Use the code example I gave you to place a CButton with a Bitmap on it.

    If you really want to use CBitmapButton, refer to this MSDN article: http://msdn.microsoft.com/library/de...tmapButton.asp

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dialog box determined to close!!!
    By mhandlon in forum Windows Programming
    Replies: 1
    Last Post: 01-18-2006, 09:33 AM
  2. Making dialog box the only window
    By PJYelton in forum Windows Programming
    Replies: 2
    Last Post: 09-06-2005, 01:02 PM
  3. Dialog box height/width differs in winXP
    By LuckY in forum Windows Programming
    Replies: 7
    Last Post: 05-04-2003, 04:13 PM
  4. help on making a box of size n
    By ericp023 in forum C Programming
    Replies: 5
    Last Post: 02-21-2003, 02:18 AM
  5. Simple Dialog Box (noob)
    By tegwin in forum Windows Programming
    Replies: 6
    Last Post: 06-30-2002, 07:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21