Ctrl Space and IntelliPrompt

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Ted Schunk
Avatar
I would like to display an "IntelliPrompt" list when the user types Ctrl+Space. I added the code below and when I press Ctrl Space the intelliprompt window appears for a split second and then goes away.

        private void editor_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space && e.Modifiers == Keys.Control)
            {
                IntelliPromptMemberList memberList = editor.IntelliPrompt.MemberList;
                memberList.Clear();

                memberList.Add(new IntelliPromptMemberListItem("A", 0, ""));
                memberList.Add(new IntelliPromptMemberListItem("B", 0, ""));

                if (memberList.Count > 0)
                    memberList.Show();

            }
        }

Comments (3)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Funny you wrote... we just had another user point out this bug today. We just fixed it and the fix will be in the next maintenance release.

Also, we recommend using our KeyTyping and KeyTyped events instead of KeyDown or KeyPress since they provide you more information.

The customer who wrote us about this bug created an EditCommand that fired on Ctrl+Space, which is a good alternative way of doing what you want. You just write the code to open the member list code in the EditCommand then. However that method still has the bug until the maintenance release.


Actipro Software Support

Posted 18 years ago by Ted Schunk
Avatar
I created a new EditCommand (see code below) and still have the same problem. Is this code correct?

Used to Add the EditCommand

editor.CommandLinks.Add(new ActiproSoftware.WinUICore.Commands.CommandLink(new TestIT(editor),
                    new ActiproSoftware.WinUICore.Commands.KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.Control, Keys.Space)));

The new EditCommand

class TestIT : ActiproSoftware.SyntaxEditor.Commands.EditCommand
    {
        private SyntaxEditor mEditor;
        public TestIT(SyntaxEditor editor)
        {
            mEditor = editor;
        }
        public override void Execute(EditCommandContext context)
        {
            IntelliPromptMemberList memberList = mEditor.IntelliPrompt.MemberList;
            memberList.Clear();

            memberList.Add(new IntelliPromptMemberListItem("Addd", 0, "dd"));
            memberList.Add(new IntelliPromptMemberListItem("Bddd", 0, "adf"));

            if (memberList.Count > 0)
                memberList.Show();

        }
    }
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ted,

Sorry, I think you misunderstood my message. Yes you did it correctly and we recommend what you did with the EditCommand as the proper way to implement the functionality. However the bug you found still exists even using that method until the maintenance release comes out, which should be soon.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.