Summary of Owner-Draw Commands


The following table summarizes all of the owner-draw string commands:

  • {@start,end} 

    Selects text from start to end character positions. Start and end can include + and - arithmetic operators, and the $ substring operator. For example, to display text from position 1 to 10 use {@1,10}. To display text up to the first comma, use {@1,$(,)}.

  • $(substring) 

    Returns the character position of substring.

  • # 

    Returns the row number. For example, to display the row number in a list box, use {@#}

  • I=imagenumber I=:imagename 

    Specifies that the owner-draw string should display an image. The image to display can either be specified by number, or by name (by specifying a colon after the equals sign). If you specify the image by number, you must include an imagelist command in the control's format string.

    • For example, to specify an image by number (the entire format string is shown here):

    • To specify the image by name:

    • You can use the @ and $ operators to the right of the = sign so that the image name or number is derived dynamically.

  • {J=[L|R] [T|B] [C]} 

    Justifies the output generated by the owner-draw string. For example, {J=LC}. Justification options are:

    • "L" = left

    • "R" = right

    • "T" = top

    • "B" = bottom

    • "C" = center (both horizontally and vertically)

    • "CL" = left, vertical center

    • "CR" = right, vertical center

  • {F=fontname,size} 

    Specifies the font to be used for text generated by the owner-draw string. For example, {F=times new roman,10}. The font can be derived from the input text using a @[,] directive. For example, {[email protected]} means that the font is derived from the entire text of the input value. So if the input text is 'Arial,12', the font is 'Arial,12'. {[email protected],$(:)-1} means that the input text, up to the first colon specifies the font to use.

  • {B=[,[,]]) 

    Change the background color for text that follows. Note that there are up to three comma separated colors because the button, list box, or combo box control has three states: normal, selected, and disabled.

  • {C=<forecolor>[,<select backcolor>[,<disable backcolor>]]} 

    Set the foreground color of text that follows.

  • {LF} 

    Inserts a line break in the output string.

  • {U} 

    Underlines the next character.

  • {T=} 

    Tab to position (in inches) and start the text/image that follows at this horizontal offset. For example, {T=0.5} will print the owner-draw output that follows at an offset of 0.5 inches.


Desktop applications only

See Also