textbox

WPF not updating textbox while in progress

隐身守侯 提交于 2019-12-17 16:40:49
问题 I have this code: void wait(int ms) { System.Threading.Thread.Sleep(ms); } private void button1_Click(object sender, RoutedEventArgs e) { info.Text = "step 1"; wait(1000); info.Text = "step 2"; wait(1000); info.Text = "step 3"; wait(1000); info.Text = "step 4"; wait(1000); } And problem is that textbox.text is updated after whole void button1_Click finished. It is not updated ON AIR :( Please, How to do that? 回答1: Just do this. private void button1_Click(object sender, RoutedEventArgs e) {

Access Rich-Text: Which subset of HTML is supported?

这一生的挚爱 提交于 2019-12-17 16:10:18
问题 Microsoft Access text boxes can be configured as "Rich Text", allowing the user to apply formatting such as bold text or different font sizes. Internally, this "rich text" is stored as HTML. Since the formatting options provided by Access are limited, it is obvious that only a subset of HTML is used for storing the formatted text. Is there a list somewhere describing which subset of HTML is used? Ideally, I'd like to have a list of tags that could be found in a text field formatted using this

How to make an auto-complete textbox in a winforms desktop application

孤者浪人 提交于 2019-12-17 15:58:08
问题 I have a list of words. The list contains about 100-200 text strings (it's names of metro stations actually). I want to make an auto-complete textbox. For an example, user press 'N' letter, then an (ending of) appropriate option appear (only one option). The ending must be selected. How to do that? PS1: I guess, there is a textbox control with a Property something like this: List<string> AppropriateOptions{/* ... */} PS2: sorry for my english. If you didn't understand -> ask me and I will try

How can I specify letter spacing or kerning, in a WPF TextBox?

大城市里の小女人 提交于 2019-12-17 15:57:22
问题 I'd like to modify the spacing between characters in a WPF TextBox. Something like the letter-spacing: 5px thing that is available in CSS. I think it is possible in XAML; what's the simplest way? I found the "Introduction to the GlyphRun Object and Glyphs Element" document, and found it to be exceedingly unhelpful. This is a code example from that page: <!-- "Hello World!" with explicit character widths for proportional font --> <Glyphs FontUri = "C:\WINDOWS\Fonts\ARIAL.TTF"

C# Resize textbox to fit content

别等时光非礼了梦想. 提交于 2019-12-17 15:55:09
问题 I'm writing a program where the user should be able to write text in a textbox. I'd like the textbox to resize itself, so it fit the content. I've tried the following: private void textBoxTitle_TextChanged(object sender, TextChangedEventArgs e) { System.Drawing.Font myFont = new System.Drawing.Font("Verdana", 8); System.Drawing.SizeF mySize = e.Graphics.MeasureString("This is a test", myFont); this.textBoxTitle.Width = (int)Math.Round(mySize.Width, 0); } I get an error saying that Graphics

Adding space between numbers?

夙愿已清 提交于 2019-12-17 15:46:44
问题 I'm trying to make a number input. I've made so my textbox only accepts numbers via this code: function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } return true; } But now the question comes to, how would I create spaces as the user is typing in their number, much like the iPhone's telephone spacing thing, but with numbers so for example if they type in: 1000 it

Auto complete and selection of multiple values in text box shiny

删除回忆录丶 提交于 2019-12-17 12:19:38
问题 Is it possible to select multi values using auto complete strings similar to google search and stack overflow tags selection in shiny text box. dataset<-cbind("John Doe","Ash","Ajay sharma","Ken Chong","Will Smith","Neo"....etc) I want to select multiple variables from the above dataset as a auto fill in my textbox and pass it to my server.R ui.R shinyUI(fluidPage( titlePanel("test"), sidebarLayout( sidebarPanel( helpText("text"), textInput("txt","Enter the text",""), #Pass the dataset here

VB.net Need Text Box to Only Accept Numbers

∥☆過路亽.° 提交于 2019-12-17 10:53:26
问题 I'm fairly new to VB.net (self taught) and was just wondering if someone out there could help me out with some code. I'm not trying to do anything too involved, just have a TextBox that accepts a numeric value from 1 to 10. I don't want it to accept a string or any number above 10. If someone types a word or character an error message will appear, telling him to enter a valid number. This is what I have; obviously it's not great as I am having problems. Thanks again to anyone who can help. If

How to change text in a textbox on another form in Visual C#?

依然范特西╮ 提交于 2019-12-17 09:57:40
问题 In Visual C# when I click a button, I want to load another form. But before that form loads, I want to fill the textboxes with some text. I tried to put some commands to do this before showing the form, but I get an error saying the textbox is inaccessible due to its protection level. How can I set the textbox in a form before I show it? private void button2_Click(object sender, EventArgs e) { fixgame changeCards = new fixgame(); changeCards.p1c1val.text = "3"; changeCards.Show(); } 回答1: When

trigger file upload dialog using javascript/jquery

[亡魂溺海] 提交于 2019-12-17 09:30:30
问题 instead of using <input type="file"> , is it possible to use <input type="text"> and then script it using javascript or jquery such that when the text box is clicked, the file upload dialogue shows up.....(and have it actually uploaded when it's submitted into a form) 回答1: You mean something like this? http://jsfiddle.net/CSvjw/ $('input[type=text]').click(function() { $('input[type=file]').trigger('click'); }); $('input[type=file]').change(function() { $('input[type=text]').val($(this).val()