tags:

views:

79

answers:

1

I want a special TextBox (May be RichTextBox) in to which I need to type lot of text and predefined fields. When I enter a special char '[' I need to get a VS like intellisense popup and mark the inserted text in a special manner like below alt text

So please suggest me a way to make the inserted field selectable as in word. so the double click on the field can bring the popup again and delete on selection should delete the entire field.

The intellisense part is working for me by adding a PopUp control below the TextBox.

+2  A: 

You can add any controls you like into the middle of a FlowDocument using the BlockUIContainer or InlineUIContainer ?

After you press your special character you could insert a control into the document...

        <RichTextBox>
            <FlowDocument>
            <Paragraph>
                Some text here followed directly by a button...
                <InlineUIContainer>
                    <Button Width="20" Height="20"/>
                </InlineUIContainer>
                            </Paragraph>
            </FlowDocument>
        </RichTextBox>

If you replace Button with your custom control for doing your special field input (including handling double click event for editing), then the highlight/delete is handled by the RichTextBox...

Schneider
Thank you for the answer that makes sense, I will try it.
Jobi Joy