Customizing the default InputBox Window

This short code sample shows how to subclass the standard VB InputBox function so that you can change the default font and fore/background colors used in the dialogs.

sshot

The program works by capturing the WM_CTLCOLORDLG, WM_CTLCOLORSTATIC, WM_CTLCOLORBTN messages as the dialog is created. A windows font and brush are then created and returned to the standard windows message handler to handle the custom drawing.

The code can be used in your program by simply calling the 'InputBoxEx' function inplace of the usual 'InputBox' statement (once you've subclassed your form of course).

A full sample project is included.

Download Zipped Project File (10k)



Comments

  • CustomizedInputBox

    Posted by Legacy on 07/31/2003 12:00am

    Originally posted by: subas sahoo

    Very Good,
    but serching for more customized.

    Reply
  • InputBox

    Posted by Legacy on 07/06/2003 12:00am

    Originally posted by: Richard

    how do I create an InputMask for the InputBox, lets say I want to add the 'Password' mask to display stars??
    

    Reply
  • Good but what about setting the Max length

    Posted by Legacy on 07/31/2002 12:00am

    Originally posted by: Brad

    The max length of the input Box is 256 characters. How about a way to set it to say 20 characters similar to the textbox maxlengh property.

    Reply
  • This is good BUT.....

    Posted by Legacy on 05/18/2002 12:00am

    Originally posted by: sunny

    This program is good but i was thinking if you can reduce its size....
    
    

    Reply
  • I was searching for Small Size Input Box

    Posted by Legacy on 09/15/2000 12:00am

    Originally posted by: J. R. Poudel

    i appericiate your work,but you have not tried to make the size of Input Box Small.
    If you get any Idea to make small size input box please inform me

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Due to internal controls and regulations, the amount of long term archival data is increasing every year. Since magnetic tape does not need to be periodically operated or connected to a power source, there will be no data loss because of performance degradation due to the drive actuator. Read this white paper to learn about a series of tests that determined magnetic tape is a reliable long-term storage solution for up to 30 years.

Most Popular Programming Stories

More for Developers

RSS Feeds