Hi everyone,

I have created a custom tab, in wich I want all the tools necessary to format a protocol document to be available and easily accessible to the users. How can I create a dropdown list with only the 5 heading styles I will need to use in the protocol? I don't want a list with all the styles in the quick part gallery. Let's say if the styles I use are Heading1, Heading2, Heading3, Heading4 and Heading5, those are the only ones I want listed in the drop down, and when the user needs it, they will select the style from the drop down and apply to the desired text in the document.

Since ComboBox will accept any objects, you can implement a ToString() override in your class that represents the styles. Then in the SelectedIndex event cast the SelectedItem to the class object that represents the styles.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.