clipboard problem in anchor bar window

A

Alex Demakov

I want to create simple Visio 2007 add-in with vsto 2005 se like example on
anchor bars in visio sdk. I'm just trying to display shape name in textbox. I
add anchor bar window, add form and then add textbox to the form. Then select
some shape in the drawing and write down its name in textbox. It's okey. But
when I hit 'del' key on keyboard, selected shape removed! instead of the
symbol in the textbox (textbox in focus and caret is displaying). When trying
to copy/paste some text into textbox, text is inserting into selected shape
not in the textbox. What's the problem?
All responses will be appreciated.
 
A

Al Edlund

It sounds like the window with the shape is in focus, not the window with the
form/text box. (make sure your addin is focused on the correct activewindow)
al
 
D

David Parker

I have had this problem and had to accept it because the anchor windows are
subwindows to the document window.
I added right mouse menu actions to Delete, Copy, Cut and Paste in the
anchor window. This worked.
 
A

Alex Demakov

When I click mouse on textbox is the addin focused in anchor bar window by
default or I have to write some additional code? When I write some text, it
appears in textbox not in shape, then I move caret left and press 'del' -
shape disappeares, text remains!
 
A

Alex Demakov

So when user tries to correct something, he/she has to avoid using 'del'
button on keyboard, otherwise shape will be deleted? This is not the
bahaviour that user expects.
 
D

David Parker

I agree, and I will look again when I have time (not today)
It was a workaround ...
 
N

Nikolay Belyh

I want to create simple Visio 2007 add-in with vsto 2005 se like example on
anchor bars in visio sdk. I'm just trying to display shape name in textbox. I
add anchor bar window, add form and then add textbox to the form. Then select
some shape in the drawing and write down its name in textbox. It's okey. But
when I hit 'del' key on keyboard, selected shape removed! instead of the
symbol in the textbox (textbox in focus and caret is displaying). When trying
to copy/paste some text into textbox, text is inserting into selected shape
not in the textbox. What's the problem?
All responses will be appreciated.

I think, that the problem is that DEL key is "preprocessed" by Visio.
To fix this you might want to handle "KeyboardEventForAddin" visio
event, looking for the DEL key.
And in case of DEL key (if your form has focus) you can direct that
DEL key to your form and cancel default visio processing.

Kind regards, Nikolay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top