How to show resizing handles at runtime?

Viewed 61

I'm trying to make a resizable TextBox at runtime.

I do some research and found out that I could make it resizable by simply add 0x40000 to CreateParams.

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.Style |= 0x40000;
        return cp;
    }
}

But it will add a thick border to the TextBox.

TextBox with thick border

I wanted it to be like the build-in resizing box when the user is designing the form.

TextBox with resizing box

I was thinking that since the VS has this functionality built in, there must be a way to utilize it at runtime.

I had gone through Window Styles and Extended Window Styles and didn't seem to find anything related to it.

I had also tried to draw it manually, but since the 8 little boxes are "outside" of TextBox, it will be "cut off", and I can't find anything teaching me how to "draw outside of the control bound".

So somebody please be so kind and teach me how to do it.

Much appreciated!

0 Answers
Related