Button border remove - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Thread: Button border remove

  1. #16
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Button border remove

    Okay. I think there is no other options rather than creating a owner draw button to server my purpose. So can you guys post here a win32 code for creating a simple windows style owner draw button which looks exactly as BS_PUSHBUTTON style.

  2. #17
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Button border remove

    Removing the border from button may not serve your purpose on all Windows OSs. Like in Windows 98/2000, buttons have different form, in Windows XP, it was changed, and in Vista it is further revamped. You should not confuse the end user. Your UI should be consistent as per the user's OS and settings.

    And what you want to achieve by removing the border? You don't want border, place a 'static' control (which doesn't have border). Handle the click events. Yes, that's absurd! Depends on your perspective, if more absurd than your idea!
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  3. #18
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,352

    Re: Button border remove

    Perhaps you'll explain us what and why you are trying to accomplish with such a button "without a boarder"?

    PS: I've just read the Ajay Vijay's post... And I totally agree with him!
    Last edited by VictorN; September 23rd, 2009 at 12:01 PM. Reason: PS was added
    Victor Nijegorodov

  4. #19
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Button border remove

    Okay let me explain my story. I'm creating a win xp exe. also can execute on other os but its particularly for xp. and im using blue background picture instead of default white or gray color of dialog box. so after creating the buttons on that blue background the light borders comes to view around the buttons. so i wanna remove them. hope now u guys dont have any confusions why im trying to do this..

  5. #20
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Button border remove

    Then you must use owner drawing. Use DrawFrameControl in your owner-draw code, to draw required control' parts in standard format.

    hope now u guys dont have anymore confusion why im trying to do this..
    No one is confused here. No one is dying here to help you. Consider your language next time.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  6. #21
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Button border remove

    Okay. Can you post a sample win32 code for creating an owner draw button looking exactly like normal BS_PUSHBUTTON.

  7. #22
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Button border remove

    One of these articles may help:
    http://www.codeguru.com/cpp/controls/buttonctrl
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  8. #23
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Button border remove

    Thanks for the link brother.

  9. #24
    Join Date
    Apr 2013
    Posts
    2

    Re: Button border remove

    Quote Originally Posted by VictorN View Post
    Perhaps you'll explain us what and why you are trying to accomplish with such a button "without a boarder"?

    PS: I've just read the Ajay Vijay's post... And I totally agree with him!
    In my case, I am trying to create a synthesizer keyboard, and was planning on an array of buttons. However, the borders are not visually appealing in the context of a music keyboard.
    I am open to suggestions, but what exactly is a "static" control?
    Are they accessible from the Properties window?

    Thanks,
    Mike

  10. #25
    Join Date
    Apr 2013
    Posts
    2

    Re: Button border remove

    After playing around a bit (I am very new to Visual C++ and Windows in general), I see that setting the borders and padding to zero work just fine *IF* you set the Flat Style to Flat instead of the default, Standard.

Page 2 of 2 FirstFirst 12

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center