textbox

Create hyperlink in TextBox control

落爺英雄遲暮 提交于 2019-12-19 13:39:19
问题 Is there some way that I could create a hyperlink within a Textbox control? The catch: I would like only certain text to act as a hyperlink. For example, StackOverflow.com allows me to make only THIS text act as a hyperlink. Is there some way to do this in C# from withing a Textbox? 回答1: Use a RichEditCtrl. Does the text need to be editable? Otherwise you could use Labels and Hyperlinks in a StackPanel. 来源: https://stackoverflow.com/questions/6564097/create-hyperlink-in-textbox-control

disable key event when the focus is on autocompletion box of textbox

那年仲夏 提交于 2019-12-19 10:25:33
问题 In my project there is a Form mainForm in which there are two textBoxes txtUserName and txtPassword and also a button btnLogin . I have given the following txtUserName properties: txtUserName Properties AutoCompleteCustomSource - Collection --> Administrator --> Clerk AutoCompleteMode - Suggest AutoCompleteSource - CustomSource btnLogin_Click Event if (txtUserName.Text.Equals("Administrator") && txtPassword.Text.Equals("123")) { //function to access admin features } else if (txtUserName.Text

Keeping radio/checkbox values on postback?

旧城冷巷雨未停 提交于 2019-12-19 10:24:14
问题 There's is something I don't get with ASP objects. I have a button in a update panel. On the same page, I have a checkbox, a radiobutton and a textbox (outside the update panel). When I click on my button, I access all those three objects. The textbox is able to keep the his text value. But the radio/checkbox always return false when I check there checked state. Of course, my form is more complicated than what I just said. It involves Javascript and usercontrols. I managed to use the Request

How to execute VBScript command within textbox from C# application?

蹲街弑〆低调 提交于 2019-12-19 10:18:15
问题 How could I execute VBScript's code from TextBox control placed in C# application? like , let's assume that I have a C# Windows Application(form) and has two controls! textbox (txtCode) button (btnExecute) txtCode has VBScript code and I want when clicking at btnExecute to execute the VBScript code!! 回答1: You can pass VBS/JS directly to the scripting runtime & pass code & objects around. Add a ref to the Microsoft Scripting Control (COM) then you can; MSScriptControl.ScriptControl sc = new

Vb.net + AutoComplete in textboxes

跟風遠走 提交于 2019-12-19 08:54:18
问题 So I was reading a bit on AutoComplete of textboxes in VB.NET, but I can't really understand where these are stored? Is it a fully built in feature, or do I have to write some code for it to work? I've found the AutoCompleteMode and AutoCompleteSource properties of textboxes. But I want to append whatever I've written in the textbox to the autocomplete source. Do I connect the source to My.Settings or something? Wouldn't I have to use an array as well? Any help would be appreciated :) 回答1:

Why my textbox TextChanged event gets fired after I enter “only” one character in my text box?

醉酒当歌 提交于 2019-12-19 07:48:23
问题 private void NameVal_TextChanged(object sender, EventArgs e) { String text = NameVal.Text; } As soon as I enter the first letter of my Name this program gets executed . How do I make the program wait until I finish entering the whole string for the field (such as Name ex: James) is entered. 回答1: If you want to determine when the user has finished typing, you can catch the leave event instead - this is fired when the focus is lost on that text box - ie the user clicks outside of the textbox:

One Event for all TextBoxes

自作多情 提交于 2019-12-19 07:24:33
问题 I´m doing simple program in WPF C# and I have many TextBoxes - each TextBox do same thing and I´m very lazy to write each Event for each TextBox . So, Is there any way how to serve all TextBox by one Event? There is a short code: private void OnMouseLeft(object sender, MouseButtonEventArgs e) { TextBox1.Text = string.Empty; TextBox1.Foreground = Brushes.Black; } private void OnMouseLeft1(object sender, MouseButtonEventArgs e) { TextBox2.Text = string.Empty; TextBox2.Foreground = Brushes.Black

One Event for all TextBoxes

浪子不回头ぞ 提交于 2019-12-19 07:24:09
问题 I´m doing simple program in WPF C# and I have many TextBoxes - each TextBox do same thing and I´m very lazy to write each Event for each TextBox . So, Is there any way how to serve all TextBox by one Event? There is a short code: private void OnMouseLeft(object sender, MouseButtonEventArgs e) { TextBox1.Text = string.Empty; TextBox1.Foreground = Brushes.Black; } private void OnMouseLeft1(object sender, MouseButtonEventArgs e) { TextBox2.Text = string.Empty; TextBox2.Foreground = Brushes.Black

WPF: TextBox Text is not updating

蓝咒 提交于 2019-12-19 06:14:12
问题 I have a user control that i am using inside a DataTemplate , this UserControl contains a TextBox which is binded with Value property(declared as a DependencyProperty ) of my UserControl . In data template I bind this Value property with my actual property say Name (also a DependencyProperty ). It works properly, I assign a value to Name property while loading and my TextBox displays it, i change the value from TextBox and it updates my Name property also. Now the problem comes while I add a

WPF: TextBox Text is not updating

梦想的初衷 提交于 2019-12-19 06:14:01
问题 I have a user control that i am using inside a DataTemplate , this UserControl contains a TextBox which is binded with Value property(declared as a DependencyProperty ) of my UserControl . In data template I bind this Value property with my actual property say Name (also a DependencyProperty ). It works properly, I assign a value to Name property while loading and my TextBox displays it, i change the value from TextBox and it updates my Name property also. Now the problem comes while I add a