简体   繁体   中英

How to make autocomplete textbox in excel cell in VSTO C# add in

I am now developing Excel VSTO add in, and I am newbie in addin development. I Found that I can Add hyperlink control to Cell directly and can handle event on it as follow.

worksheet.Hyperlinks.Add(
       rangeToHoldHyperlink,
       string.Empty,
       hyperlinkTargetAddress,
       "Tip",
        "label");

What I want to do is to add automplete text box (show autocomplete text on key down event) in specified cells as following picture.
样品照片

I know about creating dropdown cell by setting data validation list from c#. But I don't want to use this because it doesn't show on key down event and dropdown list data is limitted. And I can't find related solution from google, Please help me if anybody has already done this snippet. Thanks alot.

I suppose that you can add a NameRange control to this cell. It has several events, like Change. You can add some functions to this event. http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.namedrange.aspx I hope it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM