textbox

WPF: simple TextBox data binding

隐身守侯 提交于 2019-12-27 17:07:30
问题 I have this class: public partial class Window1 : Window { public String Name2; public Window1() { InitializeComponent(); Name2 = new String('a', 5); myGrid.DataContext = this; } // ... } And I want to display the string Name2 in the textbox. <Grid Name="myGrid" Height="437.274"> <TextBox Text="{Binding Path=Name2}"/> </Grid> But the string isn't displayed. Also, if the string Name2 is updated periodically using a TimerCallback , do I need to do anything to make sure the textbox is updated

WPF: simple TextBox data binding

淺唱寂寞╮ 提交于 2019-12-27 17:07:10
问题 I have this class: public partial class Window1 : Window { public String Name2; public Window1() { InitializeComponent(); Name2 = new String('a', 5); myGrid.DataContext = this; } // ... } And I want to display the string Name2 in the textbox. <Grid Name="myGrid" Height="437.274"> <TextBox Text="{Binding Path=Name2}"/> </Grid> But the string isn't displayed. Also, if the string Name2 is updated periodically using a TimerCallback , do I need to do anything to make sure the textbox is updated

How to set Z-order of a Control using WinForms

假如想象 提交于 2019-12-27 12:05:22
问题 I'm writing a custom TextBox that upon gaining focus changes its border style. As adding a border causes the control to overlap with those neighbouring it, I temporarily bring the text box to the front of the dialog (using textBox.BringToFront() ). However, once editing is complete and focus is lost, I would like to send the control back to its original position in the Z-order. Is this possible (preferably in a simple way!) 回答1: Call the GetChildIndex and SetChildIndex methods of the parent's

Add values to multiple textboxes (similar names)

眉间皱痕 提交于 2019-12-25 19:42:07
问题 I was trying to find the solution for this but nothing works. I have around 650 textboxes named : A001A, A002A...A600A and I would like to put values in those texboxes for instance "example value". I've found solution to put values in all textboxes in a form, but in mine there are those with some other values. Next solution is this one : Dim textBoxArr() As TextBox = {A2, A3, A4, A5, etc..} For Each tb As TextBox In textBoxArr Select Case tb.Text Case "RESNO" tb.Text = "-15,55,0" Case "DOGAL"

Copy and paste content from a textbox to a worksheet cell range?

大城市里の小女人 提交于 2019-12-25 17:44:24
问题 I'm working on a VBA project to automate the Excel tool for a service desk queries tracker. I want, once the command button is clicked, to copy the content from a textbox to another worksheet row. If I repeat the task, the textbox content should be saved in the next empty cell of the same row. I used this macro: Private Sub CommandButton1_Click() TextBox1.Text = "" TextBox1.Copy 'TextBox2.Copy 'TextBox3.Copy Range("A2").Select Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0)

Clearing Two Textbox text either one which is selected

房东的猫 提交于 2019-12-25 16:46:39
问题 I have a textbox in a Windows form, I have clear button which basically clears the text char by char(that is one by one not all at once), my problem is i want to add another textbox to this form and would like to control both the textboxes with clear button meaning the clear should only clear the textbox which i have selected or clicked on, i tried doing it but either i am able to clear both the textboxes simultaneously or clear only textbox my code for single textbox is private void clearBtn

HTML/javascript vertically expand textbox when text is too long

一笑奈何 提交于 2019-12-25 14:01:03
问题 I wish the containing element (either a or element) to automatically expand vertically to accommodate text that has reach the end of line. Is there a way to do this with plain HTML elements? If not, can I do this using javascript? Thanks. 回答1: Sorry, but there is no way to this in plain HTML. With Javascript it's possible though. Take a look at jQuery plugin: autoResize. Note: this is a plugin for jQuery. Also, see this thread for more jQuery alternatives. 来源: https://stackoverflow.com

StringFormat, ConverterCulture, and a textbox's decimal mark

痞子三分冷 提交于 2019-12-25 13:14:23
问题 I'd like to resolve a small quirk I've been having. It's not really a quirk but rather a behavior I'd like to change if possible. If I use a {N:2} StringFormat/ConverterCulture, a TextBox is forced into having a decimal mark always (even during the process of inputting text). I mean, you can't delete the dot or the comma at all, you must be able to figure out you have to move to the next "field" of the number in order to edit the decimal points by either clicking with the mouse there or

Javascript Help - prevent duplicate characters in textbox

丶灬走出姿态 提交于 2019-12-25 12:13:24
问题 Looking for a bit of help to modify some already-working JavaScript. I am using a piece of JavaScript along with a filtered textbox, the filtered text box only allows {1234567890,-} The below JavaScript works and prevents the user from entering more than 1 decimal I want to also add a dash/minus {-} to the allowed characters and prevent duplicates <script type="text/javascript"> function PreventDuplicateDecimal(evt) { var charCode = (evt.which) ? evt.which : event.keyCode; var itemdecimal =

disable the keyboard on textbox tap on windows phone

寵の児 提交于 2019-12-25 11:57:27
问题 okay, so i am now very frustrated about this topic on google, because no one asks the right questions. i have a textbox on my windows phone 8 applications right. now once i click on that textbox the SIP keyboard pops up(that part i get, it is done by the OS). now what i want to do is once i click on the textbox i dont want the SIP to open up , cause it will navigate to a another page, but i cant make it a button cause the user can edit the info in the textbox once they chose the data from the