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

  • IBM Worklight is a mobile application development platform that lets you extend your business to mobile devices. It is designed to provide an open, comprehensive platform to build, run and manage HTML5, hybrid and native mobile apps.

  • Agile methodologies give development and test teams the ability to build software at a faster rate than ever before. Combining DevOps with hybrid cloud architectures give teams not just the principles, but also the technology necessary to achieve their goals. By combining hybrid cloud and DevOps: IT departments maintain control, visibility, and security Dev/test teams remain agile and collaborative Organizational barriers are broken down Innovation and automation can thrive Download this white paper to …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds