| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > Control Templates >====== RTFToolBar Control Template ====== | [[tplcontrolrtf.htm|{{btn_prev_n.gif|Previous page}}]][[templates.htm|{{btn_home_n.gif|Return to chapter overview}}]][[tplcontrolsavebutton.htm|{{btn_next_n.gif|Next page}}]] | | || This control template requires the population of the [[tplcontrolrtf.htm|RTFTextControl]] Control Template. The **RTFToolBar** Control Template populates a group of support controls to use with the RTFTextControl control template. There are no template prompts for this control. You can [[tplcontrolrtftoolbar.htm#hidertf|disable or hide controls]] that you do not want to provide to the user. You can also modify the icons and text used on each support control. Each control is described as follows: | {{rtf01.jpg|rtf01.jpg}}**New** | Clears the contents of the RTF Control. | | {{rtf02.jpg|rtf02.jpg}}**Open** | Prompts you to load an external RTF file's contents into the RTF control | | {{rtf03.jpg|rtf03.jpg}}**Save** | Allows you to save the existing RTF control's contents to an external file. | | {{rtf04.jpg|rtf04.jpg}}**Print** | Prints the RTF control contents. | | {{rtf05.jpg|rtf05.jpg}}**Find** | Opens the //Find// dialog window, allowing you to search for text in the RTF control. | | {{rtf06.jpg|rtf06.jpg}}**Find and Replace** | Opens the //Find and Replace// dialog window, allowing you to search and replace target text in the RTF control. | | {{rtf07.jpg|rtf07.jpg}}**Cut, Copy and Paste** | Performs the standard Windows cut, copy and paste actions for selected text in the RTF control. | | {{rtf08.jpg|rtf08.jpg}}**Undo and Redo** | Allows you to //undo// the sequence of actions performed on an RTF control, and to //redo// those actions if needed. | | {{rtf09.jpg|rtf09.jpg}}**Tab Stops** | Press this button to access the //Tabs// dialog. Set your tab stops in millimeters, inches, or twips. The hotkey to move to the next tab stop is **CTRL+TAB** | | {{rtf10.jpg|rtf10.jpg}}**Paragraph Indents** | Press this button to access the //Paragraph Indents// dialog. Set the **First** line, **Left **side and **Right** side of the paragraph in millimeters, inches, or twips. | | {{rtf11.jpg|rtf11.jpg}}**Alignment Controls** | These buttons provide the standard alignment features (left, right, center, and full justification) for the selected text. | {{notebox.jpg|NoteBox.jpg}} Full justification is currently only supported in Rich Edit versions greater than 3.0. The presence of RichEdxx.DLL is required in the Windows //System// directory. {{rtf13.jpg|rtf13.jpg}} | **Bullets and Numbering/Bullet Styles** | Add bullets or numbers and set the style with these buttons. Bullets and numbering can only be applied at the //start// of a paragraph. | | {{rtf12.jpg|rtf12.jpg}}**Font and Colors** | These** **controls set all aspects of the active font and color to use in the RTF control. | {{blk2blue.jpg|blk2blue.jpg}} **Hiding or Removing Controls** If there are controls that you do not need in your application (Example: //Save// or //Print//), you can simply delete them. When you are prompted with "Do you want to delete this control template?" Press **No**, and only the individual control will be removed. To conditionally hide controls at runtime, you can use the following embedded source in the Window Manager's Init Method (just //after// the first RTFControl Initialization embed point): **IF NeedToHideSave         !locally defined flag** **    HIDE(?RTFToolSave)    !hide Save button** **    RTFControl19.AddItem(RTFToolbar:CtlButtonSave,0)** **    !the AddItem method disables Save button logic** **END** Use this technique for any button that you need to conditionally display.