Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Page layout facilities > Default styles > Default styles for question types
 
Default styles for question types
You can set different default styles for different types of questions. These correspond to the settings you can make for single questions using Question.Style, so typical examples would be setting the number of rows or columns to be used for categorical response lists, or the background color for numeric text input boxes.
To set default styles based on question types, type:
IOM.DefaultStyles.Questions[QuestionStyleTypes.<type>].<property> = <value>
<type>
One of the following question types:
Question type
Description
qsBlock
Question blocks
qsBoolean
Boolean questions
qsCategorical
Categorical questions
qsCompound
Compound questions
qsDate
Date questions
qsDouble
Double (real) questions
qsInfo
Information items
qsLong
Long (integer) questions
qsLoopCategorical
Categorical loops
qsLoopNumeric
Numeric loops
qsOther
Automatic Other Specify questions
qsPage
Multiple questions on one page
qsText
Text questions
<property>
The name of the property you want to specify.
<value>
The value of the property.
Example: Default styles for question types
With IOM.DefaultStyles.Questions[QuestionStyleTypes.qsCategorical]
.Style.BgColor = "#C0C0FF"
.Style.Color = "blue"
.Style.Columns = 2
End With
With IOM.DefaultStyles.Questions[QuestionStyleTypes.qsLong]
.Style.BgColor = "#FFFF80"
.Style.Font.Effects = FontEffects.feItalic + FontEffects.feBold
.Style.Color = "green"
End With
produces the following effects for categorical and integer questions:
This graphic is described in the surrounding text.
You can achieve even more control by combining question type styles with text and category styles:
With IOM.DefaultStyles.Questions[QuestionStyleTypes.qsCategorical]
.Style.Columns = 2
.Categories[CategoryStyleTypes.csSingle].Label.Color = "red"
.Categories[CategoryStyleTypes.csExclusive].Label.Color = "#FF00FF"
End With
IOM.DefaultStyles.Questions[QuestionStyleTypes.qsLong]_
.Labels[LabelStyleTypes.lsQuestion].Color = "blue"
displays all categorical questions in two columns, with single choice responses in red and exclusive responses in magenta. Question texts for integer questions are displayed in blue.