Converting VBA to VS 2019 Winform C#; however, the Designer's ToolBox does not list InkPicture

Giacomo Raucci 321 Reputation points
2022-01-06T14:53:43.893+00:00

I am in the process of converting a VBA app to Visual Studio WinForm C#; however, the ToolBox InkPicture Control is not listed in the Toolbox. The MS web-site for Tablet PCs lists the steps to add the InkPicture control (https://learn.microsoft.com/en-us/windows/win32/tablet/adding-ink-controls-to-a-project); however, those steps do not work for a non-touchscreen laptop that I am using for development. Do I need to move the Visual Studio Winform development S/W to a touchscreen laptop so that the InkControl is listed from the Toolbox? Or is it something else?

On a separate note, I wish to thank cooldadtx for his reply to my questions to "Winform C# equivalent methods to VBA UserForm_Initialize ande Userform_Activate. Thanks for the help.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,363 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Karen Payne MVP 35,196 Reputation points
    2022-01-06T17:36:42.603+00:00

    Right click on the ToolBox, add controls, search for the Ink library and add it and if not found you need to look at WPF using one of these packages.

    0 comments No comments

  2. Castorix31 82,031 Reputation points
    2022-01-06T18:45:05.61+00:00

    You can add it from COM Components, InkObj.dll :
    (I tested on my Windows 10 OS, not a Tablet PC, and it works (with the mouse...))

    162954-inkobj.jpg


  3. Giacomo Raucci 321 Reputation points
    2022-01-07T13:44:24.847+00:00

    With Visual Studio 2019, its unclear which project to select. Since I unsuccessfully tried via changing the .csproj, I wish to make sure that I select the correct project template. Please advise.

    163261-image.png


  4. Giacomo Raucci 321 Reputation points
    2022-01-07T16:41:33.987+00:00

    Yes, I saw the screen capture from yesterday, that is why my follow-up. Not sure what version of VS 2019 that shows a difference. Your screen capture selection is "Windows Forms App (.NET Framework). I do not show that in my version: It lists the following:
    (a) ASP.NET Web Application (.NET Framework)
    (b) Windows Forms App
    (c) ASP.NET Core Empty
    (d) ASP.NET Core Web API
    (e) Windows Forms Control Library (.NET Framework)

    Since I'm creating a Windows-based App, its not clear whether I should select (a), (b) or (e). Since I'm not creating a Web App, I assume its not (a). So, is it (b) or (e)? Not trying to be difficult, I'm just trying not to redo things again. Thanks for your understanding in this matter. If I need to download the latest version of VS 2019 (asssuming I don't have the latest version), I can do that as well. Please advise. And thanks again.


  5. Giacomo Raucci 321 Reputation points
    2022-01-07T20:49:48.827+00:00

    Ok, making progress, thanks for all of your help. I copied all 25 WinForms from 1 project to the newly created project (as you've directed). Although I was able to create the InkPicture control in my WinForm (I actually use InkPicture in 2 of the 25 WinForms). I'm now getting an Exception when attempting to load the WinForm that contains the InkPicture control. The Exception message is "ActiveX control nnn cannot be instantiated" where "nnn" is a long hex number. Searching the internet did not help much. Any ideas? And thanks in advance.

    0 comments No comments