本文介绍了我试图离线设计一个C#windows窗体应用程序,以便离线翻译成多种语言。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想设计c#窗体应用程序。为此翻译多个语言中的文本我有两个文本框,即txtbox1和txtbox2和3个按钮英语,法语,俄语 i已添加三个资源文件res.en.resx,res.ru.resx ,res.fr.resx在项目中。 在textbox1中输入文本后如果我按下法语按钮它应该将内容翻译成法语。 任何人都可以帮助解决c中按钮的代码问题 我尝试过的事情: i我试图通过在资源文件中存储一些单词来尝试没有互联网连接的离线翻译器。我需要原始文本和翻译文本都可见。i want to design c# window forms app. to translate the text in multiple langauge for this i have two textboxes i.e., txtbox1 and txtbox2 and 3 buttons english,french,russian i have added three resource files res.en.resx,res.ru.resx,res.fr.resx in the project.after entering the text in textbox1 if i press the french button it should translate the content english to french.can anyone help with the code for buttons in c#What I have tried:i am trying to work on offline translator without internet connection by storing some words in resource files. i need the both original text and translated text to be visible.推荐答案 引用:任何人都可以帮助c#中的按钮代码can anyone help with the code for buttons in c# 不确定你需要我们这里 - 当你处于表单设计模式时,如果您选择一个按钮,查看属性,选择事件(查找闪电符号iirc),您可以看到例如'click'事件。如果单击此按钮,系统将为您插入一个单击处理程序 - iirc(我没有打开VS)您可以更改处理程序的名称,但如果按钮名称正确,我通常不需要。 ...然后你在提供的按钮点击事件处理程序中填写代码来处理从txtbox1读取,翻译和设置txtbox2到结果 你需要找到自己关于WinForms的一个很好的教程来掌握这个 - 我不确定是否这个第1步:创建一个Windows窗体应用项目 [ ^ ]足够好..这个可能会更好 https://www.dotnetperls.com/button [ ^ ] .. 那是什么你自找的 ?或者您可能需要这个使用C#.NET的Google Translate桌面应用程序 [ ^ ]帮助你开始一种可能的翻译方式not sure what you need from us here - when you're in forms design mode, if you select a button, look at the properties, select the events (look for the lightning bolt symbol iirc), you can see for example 'click' event. If you click on this, the system will insert a click handler for you - iirc (I dont have VS open) you can change the name of the handler, but if the buttons are properly named I usually dont need to. ... you then fill in the code in the supplied button click event handler to handle reading from txtbox1, translating and setting txtbox2 to the result you need to find yourself a good tutorial on WinForms to get the hand of this - Im not sure if this Step 1: Create a Windows Forms Application Project[^] is good enough .. this one might be better https://www.dotnetperls.com/button[^] .. Is that what you wanted ? or maybe you need this Google Translate Desktop Application in C#.NET[^] to help you start on one possible way of doing the translate 这篇关于我试图离线设计一个C#windows窗体应用程序,以便离线翻译成多种语言。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-24 14:08