更改文本框的上下文菜单 - 拼写检查 [英] Change Contextmenu of Textbox - SpellCheck

查看:77
本文介绍了更改文本框的上下文菜单 - 拼写检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我创建了一个自定义控件,将System.Windows.Controls.TextBox添加到Winform(请参阅下面的代码)。带有TextBox的ElementHost。

I created a custom control to add a System.Windows.Controls.TextBox to a Winform (see code below). ElementHost with a TextBox.

如您所见,我将SpellCheck添加到TextBox控件。我现在想要更改此控件的Contextmenu。 contextmenu的语言是英语,但其中一个用户问我是否可以将其更改为荷兰语。但我不知道怎么做。如何
更改上下文菜单而不会丢失拼写检查。

As you can see I added the SpellCheck to the TextBox control. I now want to change the Contextmenu of this control. The language of the contextmenu is English but one of the users asked me if I could change this to Dutch. But I don't know how. How can I change the contextmenu without losing the spellcheck in it.

代码用户控制:

using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Forms.Integration; namespace IFTI_CustomControls { public class AttributeHost : ElementHost { AttributeSpellBox atb = new AttributeSpellBox(); private bool multiline; private string attributeName = ""; private const string category = "AutoCAD"; public AttributeHost() { atb.SpellCheck.IsEnabled = true; this.Child = atb; } [Description("Set the AutoCAD attribute name."), Category(category), Browsable(true)] public string AttributeName { get { return attributeName; } set { attributeName = value; } } [Description("Set textbox multiline."), Category(category), Browsable(true)] public bool Multiline { get { return this.multiline; } set { this.multiline = value; if (this.multiline) { atb.TextWrapping = TextWrapping.Wrap; atb.AcceptsReturn = true; atb.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; } } } } public class AttributeSpellBox : TextBox { public AttributeSpellBox() { } } }

推荐答案

您好davdelomb,

Hi davdelomb,

一个建议是让您的项目支持多种语言:

One suggestion is that make your project supports multiple languages:

如何在winforms中制作多语言应用程序

< a href ="https://www.codeproject.com/Tips/580043/How-to-make-a-multi-language-application-in-Csharp"target ="_ blank">如何制作多语言应用程序在C#

问候,

Stanly


这篇关于更改文本框的上下文菜单 - 拼写检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆