.NET
  Home arrow .NET arrow Color, Link and Image Editor Controls for...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Color, Link and Image Editor Controls for MFC
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-10-21

    Table of Contents:
  • Color, Link and Image Editor Controls for MFC
  • Colors
  • More Colors
  • The color picker control
  • Image Editor

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Color, Link and Image Editor Controls for MFC


    (Page 1 of 5 )

    An operating system has crucial building blocks, without which it cannot function. One of these is its controls. They work together to complete complex tasks and to make your work easier. This article will focus on some new controls for an old favorite.

    Controls also provide some harmony and common style to an operating system. This way you generally do not need to spend a lot of time learning how to use a new program if it works with an operating system with which you are already familiar. Because all applications are put together from the same building blocks (controls), once you are familiar with the OS you can use any application in it with minimal headaches.

    The last time I started to present how to use these controls if you are creating a new program within Microsoft Visual Studio with the Microsoft Foundation Class Library. I used (and will continue to use) the New Controls application you can find on the MSDN site. I completely covered the button-related controls. Today I will focus on the color, shell, font combo box, link button, image editor, browse and CVS List Box controls.

    There is a lot to learn, so let's get on with it. The link button is a sort of extension to the buttons. You could consider it more like a label on what you can click to open up a browser and visit a custom link/site. We will create pages in the same way we did in my previous article. Use the resource editor to create a common button, add a new class and replace the button with a CMFCLinkCtrl.

    Afterward you can make all the settings inside the initialization of the property page:

    CMFCLinkCtrl m_btnLink;

    ...

    m_btnLink.SetURL (_T ("http://www.microsoft.com"));

    m_btnLink.SetTooltip (_T ("Visit Microsoft site"));

    m_btnLink.SizeToContent ();

    Additionally, you may use the SetURLPrefix function. With this you can set the implicit protocol of the URL. For instance, this can be http or ftp or whatever seems appropriate. Other than these few functions, this will behave just like any other button, and you can use the same methods to change the text and complete other general actions:

    CString text (L"Alfa and Omega");

    m_btnLink.SetWindowText (text);

     

    m_btnLink.SetURLPrefix (_T ("http:"));

    m_btnLink.SetURL (_T ("www.microsoft.com"));

    m_btnLink.SetTooltip (_T ("Visit Microsoft site"));

    m_btnLink.SizeToContent ();

    More .NET Articles
    More By Gabor Bernat


     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek