textbox

File ListView, change name direct in ListView, WPF C# MVVM

徘徊边缘 提交于 2019-12-13 07:53:06
问题 I made little program where I have all files of certain folder and certain type in one listview. I like to change name of file directly inside of ListView. I made ListView with textboxes in one column and name of the file is written inside textbox. I can change name in textbox now, but will not change file name. How to do this connection between textbox in ListView and Method which will be change name? Yes I am little lost here. I am pretty fresh in MVVM WPF. My XAML code of ListView:

Textbox with decimal input improvement

╄→гoц情女王★ 提交于 2019-12-13 07:50:58
问题 I have a textbox that gets a decimal value say 10500.00 the problem is that the way I have it, when you enter a value and then enter the decimals it would not allow you to backspace or clear the textbox to input a new value.. it just gets stuck.. I have tried to set the value back to 0.00 but i think i placed it on the wrong place because it wont change it. Here is my code private void txtTransferAmount_KeyPress(object sender, KeyPressEventArgs e) { bool matchString = Regex.IsMatch

Textbox Text-Color Animation

孤街醉人 提交于 2019-12-13 07:16:59
问题 Is it possible to animate just the part of the value of textbox/label. For example, txt1.text = "This is a Sample";. then I want to animate the word "Sample" to change its color/opacity etc. If you get what i mean. If it is possible please demonstrate the code Thanks! 回答1: I think you can't do it with a TextBox as its text has no formatting options. Not sure if the Label allows it, but the TextBlock might help you: <TextBlock> <TextBlock.Triggers> <EventTrigger RoutedEvent="Loaded">

how to limit dropdown items in autocomplete textbox c#?

 ̄綄美尐妖づ 提交于 2019-12-13 07:09:32
问题 I have a textbox with autocomplete mode. When I enter first few characters, the suggestion list items exceeds more than 15. I want the suggestion items to show maximum of 10 items. I don't find property to do it. AutoCompleteStringCollection ac = new AutoCompleteStringCollection(); ac.AddRange(this.Source()); if (textBox1 != null) { textBox1.AutoCompleteMode = AutoCompleteMode.Suggest; textBox1.AutoCompleteCustomSource = ac; textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource; } 回答1

C#.NET TextBox: Change Autocomplete Font

人盡茶涼 提交于 2019-12-13 07:07:58
问题 WINFORM: If I want to change the font when the time TextBox shows autocomplete drop down list, how can I do it? I know there is no property in the TextBox control to do so. If there is any override/help class/API that can do with this, please share. Thanks. 来源: https://stackoverflow.com/questions/7203381/c-net-textbox-change-autocomplete-font

Event to take control's text via event args

痞子三分冷 提交于 2019-12-13 07:07:14
问题 What is the event I should subscribe to in order to get TextBox 's Text in the event args? I've tried PreviewTextInput , but if input string is, for example, "122." the box's (see code) text is without the dot but eventArgs.Text is "." and the input string validating successfully and TextBox.Text is "122..". What I want to do is to validate if the input string is decimal by calling decimal.TryParse . private void OnPreviewTextInput(object sender, TextCompositionEventArgs eventArgs) { var box

Textbox values to array

旧时模样 提交于 2019-12-13 06:51:25
问题 i've got a few Textboxes and I want to loop through them and check if they contain a value, and if they do, put it into an array. The textboxes are called txtText1, txtText2....txtText12. This is what I got so far: for (int i = 1; i < 13; i++) { if(txtText[i] != String.Empty) { TextArray[i] = Convert.ToString(txtText[i].Text); } } ..but txtText[i] is not allowed. How can I loop through these boxes? 回答1: Ideally, by putting them in an array to start with, instead of using several separate

Cannot enter dot in a textbox

北慕城南 提交于 2019-12-13 06:49:33
问题 In my grid view i have link type column. as we cannot edit cell of such type i am displaying a text box if user select cell for editing. but my text box is unable read dot character. I checked "key pressed" and "text changed" events but events are not triggered for dot as a input. EDIT: I can enter any character or symbol except dot.. ;( I am displaying textbox on cell click event of gridview if (DataGrid.Columns[e.ColumnIndex].GetType().Name == "DataGridViewLinkColumn") { txt_Data.Location =

appendtext on text box only shown in the end all together in wpf

老子叫甜甜 提交于 2019-12-13 06:47:43
问题 I have a simple textbox in my program. Other features : another input from the user textbox1, and a button. Once the user enters a value in textbox1, and presses the button, I start to check and print messages to the user. My problem is that I don't see those messages on real time, one at a time. The messages appear at once, in the end. I didn't define data binding, because I thought that since it's a simple thing, I wouldn't need it, or am i wrong ? This is a very small portion of my program

Calling javascript function with button and input from textbox

点点圈 提交于 2019-12-13 06:29:28
问题 I have a textbox and button in my page. I have several sets of the below for different purpose. <input type="text" id="new" name="new" value="1" /> <input type="button" value="Edit" onclick="compute(edit(xxx));" /> Upon clicking on the button, I want to call a javascript function which will take in the value input in the textbox. Now I am wondering how am I suppose to retrieve the value from the input 'new' and pass it the 'xxx' as argument? 回答1: <input type="button" value="Edit" onClick=