CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2003
    Posts
    162

    Question on toolbar button text

    I have created a toolbar in dialog

    Code:
         if (!m_Toolbar.Create(this) || !m_Toolbar.LoadToolBar               (IDR_TOOLBAR1))
    	{
    	          TRACE0("Failed to create toolbar\n");
    	          return -1;      // fail to create
    	}
    
    	m_Toolbar.ModifyStyle(0, TBSTYLE_FLAT);
    
    	m_Toolbar.SetButtonText(0,"Add");
    	m_Toolbar.SetSizes(CSize(75,55),CSize(32,32));
    After that i used some code from others to embed the toolbar into the dialog

    Code:
    ...................
    ...................
    ...................
    RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0);
    I've use GetButtonText to confirm that the text is being added but it just don't show up....

    Did i missed any step to show the button text??

    Thanks......
    0 error(s), 0 warning(s)

  2. #2
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    Did you go in to the toolbar resource and actually change the
    size of the button bitmaps?
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  3. #3
    Join Date
    Aug 2003
    Posts
    162
    the size of bitmap is 32 x 32
    0 error(s), 0 warning(s)

  4. #4
    Join Date
    Aug 2003
    Posts
    162
    this code works well in mainframe toolbar... i tried it in another program but it don't works in dialog...
    0 error(s), 0 warning(s)

  5. #5
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    Could you post the project for the dialog?
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  6. #6
    Join Date
    Aug 2003
    Posts
    162
    this is it... hope there is an solution

    thanks in advance.....
    Attached Files Attached Files
    0 error(s), 0 warning(s)

  7. #7
    Join Date
    Aug 2003
    Posts
    162
    ???
    0 error(s), 0 warning(s)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured