Menu
  • HOME
  • TAGS

Enable text hovering cursor when textbox is empty

wpf,xaml,textbox,cursor

The default behavior displays the I Beam when you mouse over a textbox, I'm unsure what is going on with your textbox, you may be overriding this behavior in a style. You could implement this trigger to get around it: <TextBox> <TextBox.Style> <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}"> <Style.Triggers> <Trigger Property="IsMouseOver"...

How Jquery get textbox array value when checkbox value checked?

jquery,checkbox,textbox

You don't need to iterate through each textbox since you will have only one textbox and checkbox in each tr. When you check checked property of each checkbox and if it is checked get the textbox value associated with it as below: DEMO function submitbookdata() { var bookidArr = [];...

jquery checkbox and textbox validation

jquery,checkbox,textbox

I created 2 propertes, disabled1 and disabled2. The first one holds the validation of the textfields the second one holds it for the checkboxes. If both validations succeeds then the button gets enabled else disabled. Code $(document).ready(function() { var disabled1 = true; var disabled2 = true; var checkboxes = $("input[type='checkbox']");...

Output Command Line (.Bat FILE) show in textbox with c#

c#,textbox

You need to read the output in your proc_OutputDataReceived handler, and not via proc.StandardOutput.ReadToEnd(); In other words, put something like textbox1.BeginInvoke(new Action(()=>{textbox1.Text=e.Data;})); in the proc_OutputDataReceived handler (e is a DataReceivedEventArgs argument)...

TextBox MaxLength property is counting whitespace

wpf,textbox,whitespace,maxlength

You could create your own attached property: <TextBox wpfApplication4:TextBoxBehaviors.MaxLengthIgnoringWhitespace="10" /> With the attached property defined like this: public static class TextBoxBehaviors { public static readonly DependencyProperty MaxLengthIgnoringWhitespaceProperty = DependencyProperty.RegisterAttached( "MaxLengthIgnoringWhitespace", typeof(int), typeof(TextBoxBehaviors), new PropertyMetadata(default(int), MaxLengthIgnoringWhitespaceChanged)); private static void...

I get an error: Additional information: Object reference not set to an instance of an object

c#,mysql,textbox

Please initialize your vector. It's null without using new with array. Change your code to public string[] vector = new String[3]. Please replace 3 with the size you intend.

C# read more lines in text box and edit each line [closed]

c#,textbox,readline

for( int i = 0; i < textbox.Lines.Length; i++ ) readanddosomething(); Textbox.Lines is the method you want to use. Allows you to access the lines in a textbox via....Textbox.Lines[index]...

Finding page controls starting with some string

c#,asp.net,textbox,control,findcontrol

You can include the Extension Method to get all the textboxes on page mentioned in this answer and then can simply filter with the Id you need like this:- var alltextBoxes = this.Page.FindControls<TextBox>(true).Where(x => x.ID.Contains("xyz")); If you want all the Ids which starts with some specific text say xyz, then...

ActiveX textbox value looping

vba,textbox,activex,word-vba

It seems we cannot do it easy way. The following sub works for me. Sub tst() Dim myValue(1 To 3) Dim shp As InlineShape Dim i As Long 'counter On Error Resume Next For i = 1 To 3 For Each shp In ActiveDocument.InlineShapes If Not shp.OLEFormat Is Nothing And...

Windows Forms C++: Replace dot with comma in textbox input

c++,winforms,input,textbox,c++-cli

You need to use the KeyPress event rather than the KeyDown event. This event uses KeyPressEventArgs and so rather than if (e->KeyCode == Keys::OemPeriod) { you need to use if (e->KeyChar == '.') { ...

Making empty textbox

c#,winforms,textbox

If you want to treat them array-like, you need to add them to an array, or rather and much better a List<TextBox>. Do it once and you can loop over it for any or your needs.. Do it once..: List<TextBox> boxes = new List<TextBox>() { txtPassword, txtVoornaam, txtAchternaam, txtWoonplaats, txtPostcode,...

How to identify a particular text box?

textbox,ms-word,word-vba,word-2013

First find out what is the name of that textbox. For that you can use this code Sub Sample() Dim shp Dim R1 As Word.Range Set R1 = ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range For Each shp In R1.ShapeRange Debug.Print shp.Name Next shp End Sub Once you know the name then simply use that name...

In multiline textbox, my cursor automatically goes to next line

c#,winforms,textbox,cursor,multiline

Have you tried to set KeyPressEventArgs.Handled to true? This marks the event as handled and further processing is skipped. In order to work, your EventHandler needs to come prior the internal one.

Add TextBoxes Dynamically in VB.NET

vb.net,visual-studio-2012,textbox

Below code will help you Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim XPos, YPos As Integer Dim i As Integer = 1 Dim j As Integer = 1 Dim newBox As TextBox XPos = 20 YPos = 30 For i = 1 To 10...

How change 2 different UI text via C# script in Unity 4.6

c#,text,unity3d,textbox

I didn't figured out why that wasn't working but now is solved: public Text GuessUI; public Text TextUI; TextUI.text = "Welcome to Number Wizard!"; GuessUI.text = "500"; And I set up this in inspector: ...

Textbox doesn't keep selection on binded list update

c#,wpf,textbox,selection

You could prevent this with some handling of the SelectionChanged and TextChanged events. <TextBox Text="{Binding Messages, Converter={StaticResource ListToStringConverter}}" HorizontalAlignment="Center" SelectionChanged="TextBox_SelectionChanged" TextChanged="TextBox_TextChanged" /> Then, in the handlers: private int selectionStart; private int selectionLength; private void TextBox_SelectionChanged(object sender, RoutedEventArgs e) { var textBox = sender as TextBox; selectionStart = textBox.SelectionStart; selectionLength =...

WPF | VB .Net || Textbox Placeholder

wpf,vb.net,xaml,textbox,placeholder

There's nothing wrong with a XAML only solution. <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}" x:Key="TextBoxWithWatermarkStyle"> <Setter Property="Padding" Value="3"/> <Setter Property="Background" Value="White"/> <Setter Property="Foreground" Value="Black"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Border BorderThickness="1" CornerRadius="1" Background="{TemplateBinding Background}"> <Grid>...

zk textbox value empty on drag and drop

textbox,drag,zk

I made a ZKFiddle for your problem (as I understood): http://zkfiddle.org/sample/22qriko/1-zk-textbox-value-empty-on-drag-and-drop It's seems to be a ZK issue with onChanging event and the drag&drop in a textbox. As you can see in the zkfiddle, the onChanging event is not call after a drag& drop as we could expect. If you...

How to set a textbox to allow only numbers, one (1) comma, AND a dash (for negative numbers) at the beginning

c#,textbox,keypress

You can try regular expressions like ^[0-9]([.,][0-9]{1,3})?$ or ^-?\d*\.?\d* Here is an example of validation method private void ValidateText(object sender, EventArgs e) { TextBox txtBox = sender as TextBox; String strpattern = @"^-?\d*\.?\d*"; //Pattern is Ok Regex regex = new Regex(strpattern); if (!regex.Match(txtBox.Text).Success) { // passed } } ...

vb.net Get value from webbrowser to textbox

vb.net,textbox,value,getattribute

A quick and dirty way to do this would be to: 1) Download the HTML contents of the web page into a string using the following code: Dim htmlContent As String = New System.Net.WebClient().DownloadString(<Enter URL Here>) 2) ... and then search the string for your code. One way to do...

Change in last Textbox will update all textboxes with the same value

validation,c#-4.0,textbox,wpf-4.0

You're binding both of the TextBox's to the 'Name' Property, <Binding Path="Name" Mode="TwoWay" UpdateSourceTrigger="LostFocus"> For example, in your case I would bind the ClientId TextBox to <Binding Path="ClientId" Mode="TwoWay" UpdateSourceTrigger="LostFocus"> ...

Populate Userform textbox based on cell selected by Combox

excel,vba,combobox,textbox,userform

This should get you started. It populates the forms combobox with your values(which you had already) and the Vlookup finds the currency associated with the values in the combobox. Double check that your ComboBox and TextBox Name property matches your code. Private Sub UserForm_Initialize() ComboBox1.List = Worksheets("Sheet1").Range("A23:A30").Value End Sub Private...

Loop user input from text boxes in Swift

ios,swift,while-loop,textbox

The answer is: Don't do this ! You don't need to loop textFields to watch for value changes. The correct way to do this is using using the UITextField's delegate methods like - textFieldDidBeginEditing: to know when user did begin editing, - textField:shouldChangeCharactersInRange:replacementString: when the textField text value changes -...

Automatically show string on form open

c#,string,textbox

There are plenty of places where you can initialize the value of a textbox. One common place would be the Form's constructor. Something like private void Form2_Load(object sender, EventArgs e) { string userName = Environment.UserName; usernametextBox.Text = (userName); } That would be the constructor of the second form, the one...

How to properly display TeX strings in axes' datatips? (MATLAB hg2)

matlab,textbox,matlab-figure,undocumented-behavior,matlab-hg2

After some digging using uiinspect, I found that the "TextBox" is now stored as a matlab.graphics.shape.internal.GraphicsTip type of object within obj's TipHandle property which, in turn, has an Interpreter property! Both properties are public and can be set easily using dot notation. I've ended up using the following code: function...

Display value from datagridview to textbox in other form c#.Net

c#,vb.net,winforms,datagridview,textbox

It's been a while since I used Winforms, but personally I would use events: bind the appropriate DataGridView event (in this case CellClick is probably most relevant) to a method that lives inside Derogatory Form. From that method you should be able to access the event information, which should allow...

how to add numbers from inputbox?

vb.net,winforms,for-loop,textbox

Save amount of times in the variable and use For Next loop for asking another values Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim amountValue As String = InputBox("Enter Amount Of Courses") Dim amountOfCources As Int32 If Int32.TryParse(amountValue, amountOfCources) = True Then For i As Int32 =...

C# WPF: Changing color of Text upon Character Detection

c#,wpf,textbox,textchanged

You cannot use TextBox to change some specific portion of color. In this case you need RichTextBox. You use the PreviewTextInput event to get the typed text/char. I have written some logic to make the foreground of the RichTextBox change when typing specific char. I think you can build your...

DataGridTextColumn's “TextBox” styling isn't consistent with its “TextBlock”

wpf,textbox,datagridtextcolumn

The blue color might be one of the highlight key brushes from the SystemColors (see the List of SystemColors) For filling the width of your cell, you maybe could try binding the width of the textbox to the cell like this: <Setter Property="Width" Value="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridTextColumn}}}"/> EDIT:...

Select all text in textbox with autocomplete (C# winforms)

c#,winforms,autocomplete,textbox,selectall

If I add the following code, the behavior stops: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Control | Keys.A)) { SelectAll(); return true; } return base.ProcessCmdKey(ref msg, keyData); } but I'm still not sure why the append feature on Autocomplete mode deletes the text without...

Doing the maths of numbers in a listbox based on the first character of each item

c#,math,textbox,listbox

I've made a small example on this: <Window x:Class="AddTotalListConverter.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:AddTotalListConverter" Title="MainWindow" Height="350" Width="525"> <Grid> <Grid.Resources> <local:ComputationConverter x:Key="ComputationConverter"/> </Grid.Resources> <StackPanel> <ListView x:Name="lvNumbers" ItemsSource="{Binding numbers}">...

Html webpage print function does not displaying text box values

html,printing,textbox

I think what you are trying to do to print specific div First of all use document.getElementsByID() and in your code add printcontents += inpText before document.body.innerHTML = printContents; like this: function printDiv(divName){ var originalContents = document.body.innerHTML; var inpText = document.getElementsByTagName("input")[0].value; var printContents = document.getElementById(divName).innerHTML; printContents += inpText; document.body.innerHTML =...

VBA - UserForm with multiples TextBoxes in infinite calculation loop

vba,excel-vba,textbox,infinite-loop,userform

Something like this: Private bIsUpdating As Boolean Private Sub TxtNewVal_Change() If bIsUpdating Then Exit Sub bIsUpdating = True ... update other text boxes bIsUpdating = False End Sub Private Sub TxtValEUR_Change() If bIsUpdating Then Exit Sub bIsUpdating = True ... update other text boxes bIsUpdating = False End Sub ......

Javascript popup text box on submit

javascript,textbox,submit

Use the prompt() dialog box method and then pass the value entered by the user using GET method with your php script. To see how to use prompt() go here: www.w3schools.com/js/js_popup.asp

C# Delete Row with Dynamic Textbox/Button/Grid

c#,wpf,button,dynamic,textbox

WPF's ItemsControl is the correct way to show items in your views when the number of items can change. Many controls inherit from ItemsControl, like the ComboBox itself, or the DataGrid, or the ListBox... But in this example I'll use ItemsControl directly, since what you're trying to do doesn't need...

Is it possible to repeatedly use the same text box to get input from users in HTML & Javascript?

javascript,html,input,textbox

You can definitely re use the same text box to take in more than one piece of information. The question is how do you store the info in the process. So you can keep the onclick handler that you already have, then change what you do with the input based...

Javascript allow only text value

javascript,asp.net,textbox

You can just extend your regex like this: ^[\ba-zA-Z\sğüşöç\s]$ This will allow one character of the below: \b a backspace character (ASCII 8) a-z a single character in the range between a and z (case sensitive) A-Z a single character in the range between A and Z (case sensitive) \s...

click textbox (to enter characters), when submit is clicked

textbox,click,submit,enter

Could you reformulate please ? Not very clear, here... By the way, if you want to get the value of "textbox" with the following instruction " var txt = document.getElementById("textbox"); " , then you need to correct it like this : var txt = document.getElementById("textbox").value;...

Modify a value in a foreach to change another one

javascript,php,foreach,textbox,value

You need to use date and strtotime for this:- <td>'.date('H:i:s', strtotime('+15 mins'.$row['date_add'])).'</td> As you comment earlier, try like this:- $value = 10; '<td>'.date('H:i:s', strtotime("+$value mins".$row['date_add'])).'</td>'; you can change $value dynamically.thanks....

Textbox hover background image moves and re-sizes

html,css,kendo-ui,textbox,kendo-asp.net-mvc

Solved my own problem. I needed to override the hover setting for the Textbox with CSS. Here is the additional code added: input.k-textbox:hover{ background-size:19px; background-repeat:no-repeat; background-position:12px 50%; } ...

How to check if a textbox has a line from a TXT File with C#

c#,textbox,.net-4.5,streamreader

string usersTXT = sr.ReadLine(); Reads exactly one line. So you are only checking if you match the first line in the file. You want File.ReadALlLines (which also disposes the stream correctly, which you aren't): if (File.ReadAllLines(usersPath).Contains(user_txt.Text)) { } That reads all the lines, enumerates them all checking if your line...

C# Unit Test on Textbox Input from user

c#,unit-testing,textbox

you could pass the data directly to the form in form1.cs and than to check your Data model is correct at some point down the chain. in a web application you could input the data with selenium and test the DTO down the chain- in desktop might be there is...

Label linked to a text box value

excel,vba,textbox,label

put your code under the textbox_change event Following works fine Private Sub TextBox1_Change() If Me.TextBox1.Value < 0 Then Me.Label1.Visible = True Else Me.Label1.Visible = False End If End Sub ...

Update Text Field While Automating iPhone App

iphone,xpath,textbox

Call this method before passing the value to the Locator. method_name(){ Actions actionObj = new Actions(driver); actionObj.keyDown(Keys.CONTROL) .sendKeys(Keys.chord("A")) .keyUp(Keys.CONTROL).keyUp(keys.DELETE) .perform(); } findElement By xpath add a condition like getText()!="" and then It will be done. Is it working??...

icon inside textbox html css

html,css,textbox,icons

Yes. left and no-repeat are part of background. Try this: #regtxt{ background-image:url('images/usericon.png') left center no-repeat; } Make sure that the image/path is correct and no other css rule is overriding this. Edit: try with an inline image: #regtxt{...

NSIS : How to keep input value from previous dialog after click Next/Back button?

textbox,dialog,nsis

You are on the right track by always saving the text in $CUS_FULLNAME in the leave callback but you never use $CUS_FULLNAME to set the text when creating the page, you seem to try to do something with ${CUS_FULLNAME} instead! It should probably look more like this: ${NSD_CreateText} 60u 50u...

C# adding/subtracting/multiplying/dividing different items in listbox based on first character of item

c#,math,textbox,listbox

In the try block something like switch (line[0]) { case '+': num += Convert.ToInt32(line.Substring(1)); break; case '-': num -= Convert.ToInt32(line.Substring(1)); break; } where line is the current line and num is your running total. The substring will make a new string by including everything except the first character in line....

Why does my text value not appear in matlab gui?

sql,matlab,textbox,matlab-guide

If results is a cell array then simply do: set(handles.edit1,'String',results{1}); and repeat for each string. Or, if you wish, you can use arrayfun: arrayfun(@(k) eval(['set(handles.edit' num2str(k) ',''String'',results{' num2str(k) '}); ']),1:5); ...

Javascript: How to get value of textbox in form, then append them to a predefined string AND redirect browser to the value of the result

javascript,jquery,forms,textbox

You can try something like this : <!DOCTYPE html> <html> <body> <input type="text" id="urlInput" value="12345"><br> <p>Click "GO" to be redirected to the URL.</p> <button onclick="redirect()">GO</button> <script> function redirect() { var url = "http://mywebsite.com/track/" + document.getElementById('urlInput').value; window.location=url; } </script> </body> </html> ...

set padding to dynamic textbox C# asp.net

c#,asp.net,textbox,alignment

I hope you know something about CSS and stylesheets? You can render anything you want in the backend like in your example: textboxes. Using CSS you can add some style to it. This doesn't needs to be done during the creation of your controls. In your example just create a...

How can I create a catch that ensures nothing other than a number is entered into a textbox but also accepts a blank entry

c#,wpf,textbox,try-catch

You can simply use a in-line if statement like this: try { string lessTrade = (string.IsNullOrEmpty(lessTradeInTextBox.Text)) ? "0" : lessTradeInTextBox.Text; string vehiclePrice = (string.IsNullOrEmpty(vehiclePriceTextBox.Text)) ? "0" : vehiclePriceTextBox.Text; if (decimal.Parse(lessTrade) > decimal.Parse(vehiclePrice)) { MessageBox.Show("The trade-in price cannot be greater than the purchase price"); Keyboard.Focus(lessTradeInTextBox); } else { // calculations go...

Bind width of a textbox inside VisualBrush

c#,wpf,xaml,textbox,wpf-binding

The way to do this is to bind the width of the TextBox in CueBannerBrush (your VisualBrush) to the main TextBox parent (txtboxSearch). However, this only works if you place the CueBannerBrush definition into the control or window resources, not in the TextBox.Style resources: <Window.Resources> <VisualBrush x:Key="CueBannerBrush" TileMode="Tile" Stretch="None" AlignmentX="Left"...

Find textbox value in 2 nested gridviews

asp.net,gridview,textbox

Try this... foreach (GridViewRow row in grdSubClaimOuter.Rows) { if (row.RowType == DataControlRowType.DataRow) { GridView gvChild = (GridView) row.FindControl("grdSubClaim"); // Then do the same method for Button control column if (gvChild != null) { foreach (GridViewRow row in gvChild .Rows) { if (row.RowType == DataControlRowType.DataRow) { TextBox txb = (TextBox)row.FindControl("TextBox1"); if...

How to restrict swear word input when using a textbox within Visual Basic

input,textbox

You need a 'string contains' function. If you're writing in vb.net try String's Contains function, which is used like this: Dim b As Boolean b = s1.Contains(s2) If you're not writing in .net try InStr function. You can use it as follows: InStr("find the comma, in the string", ",") EDIT:...

Split comma separated strings 5 [closed]

c#,windows,datagridview,textbox

You do not need Split here, Just replace the comma in the string, string.Replace str = str.Replace(",", " "); Edit string []arr = str.Split('c'); txt1.Text = arr[0]; txt2.Text = arr[1]; txt3.Text = arr[2]; txt4.Text = arr[3]; txt5.Text = arr[4]; ...

Focusing on a textbox in a different page

javascript,html,button,textbox,focus

You can only do what you're after if the new page you're opening is on the same domain as the page that is running the JavaScript. If it is not on the same domain then the then you will not have access to the elements within the DOM of that...

I would like to control Form1 from Form2 (textbox,picturebox) [duplicate]

c#,winforms,textbox,picturebox

This is your problem: Form1 frm1 = new Form1(); You're creating a new instance of Form1. So you're successfully modifying the values on that new instance, but doing nothing to the instance you already have. Form2 needs a reference to the existing instance, not create a new one. You can...

ASP.NET : Multiple elements for an event doesn't work

c#,asp.net,events,textbox

I found my mistake. when I created my textboxes, I put a text 'X' or 'Y'. And when the event triggered, all textboxes have a text, this is why it doesn't work first time, but after, it works. Thanks everybody for your help and advice....

ASP.NET TextBox OnTextChanged Event not fired

javascript,c#,asp.net,search,textbox

I think its better to use ajax and jquery for what you are trying to accomplish than to postback every key press. Please check this LINK for more details and example. Also, the OnTextChanged event fires when you loose focus and not while you type, which seems your requirement. From...

Javascript won't get value from textbox issue, why not?

javascript,input,textbox

You need to add the id attribute to your <input> element, like this... <input type="text" name="birthdatebox" id="birthdatebox" /> ...

TextBox binding is not working

c#,wpf,binding,textbox,command

Simple, you are using two different objects! DataContext = new SearchBarViewModel() in the SearchBarView sets the DataContext where the button lives to an instance of SearchBarViewModel. No problem. But you then do <UserControl.DataContext> <ViewModel:SearchBarViewModel /> </UserControl.DataContext> In the other view, which also creates an instance of that object. Thus, the...

access the system caret blink rate in java

java,swing,textbox,cursor,caret

The method for configuring the cursor blink rate is highly system dependent, and there is no simple (cross-platform) way to access the rate in Java. For example: On Linux - http://unix.stackexchange.com/questions/55423/how-to-change-cursor-shape-color-and-blinkrate-of-linux-console On Windows - https://msdn.microsoft.com/en-us/library/ms971316.aspx#atg_avoidflashing_adjusting_the_cursor_blink_rate_programmatically (These are not direct solutions ... but they illustrate the problem that you would have.)...

TextBox access from different class [closed]

c#,wpf,class,textbox

Fast example: <Window x:Class="ButtonClickedFeedbackICommand.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ButtonClickedFeedbackICommand" Title="MainWindow" Height="350" Width="525"> <Grid> <Grid.DataContext> <local:ViewModel/> </Grid.DataContext> <StackPanel Orientation="Horizontal"> <TextBox x:Name="tbFeedback" Text="{Binding ClickedFeedback}" MinWidth="50"...

ControlTemplate Trigger

xaml,triggers,textbox

This assumes you want to border to be changed when you have it focused, since clicking a textbox focuses it. There is no OnClick property available, this changes the border of a textbox once you have it focused. <Trigger Property="IsKeyboardFocusWithin" Value="True"> <Setter Property="BorderBrush" TargetName="Border" Value="Blue"/> </Trigger> Edit: To simply remove...

I cant get the CMD outputs to display in my textbox.

c#,cmd,textbox,user,boolean

First you're putting the output variable textBox2.Text, then you are replacing the textBox2.Text with err and I believe you're getting nothing from err variable, that's why TextBox2 is not displaying what you're expecting. try to run the snippet below to check how output and err variable are getting: string userName...

how can I display the information in a textbox from this code?

c#,textbox,return-value,boolean-logic,registrykey

Try This - comments are inline. I assumed that code retrieving keys is correct. Also remember, that different systems have different registry keys, so you will need to create logic to recognize which system you running it on and then go through possible locations, and you may also need create...

C# WPF Android like zoom if TextBox gets Focus

c#,wpf,textbox,touch

you can achieve this function from this code <TextBox Background="LightGreen" Width="100" Height="100" BorderBrush="Green"> <TextBox.Style> <Style TargetType="TextBox"> <Style.Triggers> <Trigger Property="IsFocused" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <ThicknessAnimation Duration="0:0:0.400" To="3" Storyboard.TargetProperty="BorderThickness" /> <DoubleAnimation Duration="0:0:0.300" To="125" Storyboard.TargetProperty="Height" />...

Highlight line(s)/characters in WPF

wpf,textbox,lines,highlighting

Use RichTextBox. You can't use TextBox, that is because TextBox has only one style applied to all text. Use the TextRange.ApplyPropertyValue method. A TextRange is specified by its starting and ending position, which are two TextPointer. Something like this var startingPos = RichTextBox1.ContentStart.GetPositionAtOffset(n1, LogicalDirection.Forward); var endingPos = startingPos.GetPositionAtOffset(n2 - n1,...

Getting Multi Rows in Database and transferring it in a multiline textbox in VB.net WinForms

database,vb.net,winforms,textbox

I don't think you need to first query the db to get the count of records before then going back to the db to get the phonenumbers, you could just do this: mycom.CommandText = "SELECT Cellphone FROM tbl_applicant where Gender='Female';" myr = mycom.ExecuteReader While myr.Read() TextBox1.Text = TextBox1.Text & myr(0)...

Form textbox content with javascript

javascript,forms,textbox

Might be too easy, but setting the text over a style to lowercase transform doesn't allow uppercase :) function toLower(element) { if (element && element.value) { element.value = element.value.toLowerCase(); var target = document.getElementById('realvalue'); target.innerHTML = element.value; } } <input type="text" onblur="toLower(this)" /> <div id="realvalue"></div> ...

TextBox.TextChange to update an onscreen ListBox in C#

c#,forms,search,textbox,listbox

The problem is that you are looping though lb, which you delete the first time the text_Changed-Event triggers. So you don't have any items more that you can loop through and filter your ListBox. The easiest way to fix that would be not getting the items you loop though from...

Linq Query then highlight xml text in texbox

.net,xml,linq,c#-4.0,textbox

Assumig, you hold xml as text in a textbox, eg. <?xml version="1.0" encoding="UTF-8"?> <note> <to> Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> and you want to highlight <from>Jani</from> with textBox.Select function, you could try this: const string searchString = "<from>Jani</from>"; var searchStringIndex = textBox1.Text.IndexOf(searchString, StringComparison.Ordinal); if(searchStringIndex...

How do I add a vertical scrollbar to a textbox?

vb.net,textbox,scrollbar

Vertical scroll bars can be added to TextBox form objects, but however they must be Multiline: This can either be done by setting Multiline to True and ScrollBars to Vertical: or it can be done via code, programmatically, as per se: TextBox1.Multiline = True TextBox1.ScrollBars = ScrollBars.Vertical You can set...

C# Digit-only TextBoxes in a GroupBox.

c#,events,textbox,groupbox

You can try this code : private void textBox_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.')) { e.Handled = true; } // only allow one decimal point if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1)) { e.Handled = true; } } The source...

VB Remove duplicate lines from textbox

vb.net,visual-studio,textbox,duplicates

You could use a HashSet(Of String) + String.Join: Dim uniqueUrls As New HashSet(Of String) For Each curElement As HtmlElement In theElementCollection If curElement.GetAttribute("href").Contains("/watch") Then uniqueUrls.Add(curElement.GetAttribute("href")) End If Next TextBox1.Text = String.Join(vbCrLf, uniqueUrls) ...

C# Windows Form Application - value not printing in textbox for each time

c#,winforms,textbox,windows-forms-designer,form-control

In C# Window application, control values are render after event is executed. After your click event textbox is displaying last value that is updated. If you want to render text-box value during event execution.You have to call refresh method of text-box to render value. Use this.. You have to refresh...

VB.NET Transferring ListBox and Textbox Data

vb.net,textbox,listbox

You can use & to concatenate the two strings into one and add the resulting string to the Items collection of ListBox2. Don't forget to check that you have an item selected in ListBox1. If ListBox1.SelectedIndex >= 0 Then ListBox2.Items.Add(TextBox1.Text & " " & ListBox1.SelectedItem) End If ...

NSIS : Why “Text” from text box value became numeric?

textbox,nsis,mui

I'm guessing you are writing the controls handle to the file but it is impossible to know because of your poor example code. It should probably look something like this: InstallDir "$Temp\Test" !include TextFunc.nsh !include nsDialogs.nsh var hCtlUrl var hCtlUsr var hCtlPwd !define DefaultUrl "url.localhost" !define DefaultUsr "foo" !define DefaultPwd...

Disable all texboxes, datetimepicker, comboboxes programatically

c#,windows,winforms,textbox

You can use OfType() and then in Where() get specific type control and then iterate and disable them or enable them as desired like this: if (sEnable == "Disabled") { var controls = this.Controls.OfType<Control>().Where(x=>x is TextBox || x is ComboBox || x is DateTimePicker); foreach(var control in controls) control.Enabled =...

c# Pass a multi-line string to a function and return an array

c#,arrays,string,textbox,return

You need a parameter and return type (string array), you may need to read more about Passing Parameters and return statement for returning values. private string[] Load_Signal_Strength_Array(string signalStrengthInput_450) { string[] SignalStrengthInputArray450 = SignalStrengthInput_450.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); foreach (string a in SignalStrengthInputArray450) { // loads some stuff into the...

Are there memory limitations when outputting to a ScrolledText widget?

memory,logging,textbox,tkinter,python-3.4

In general, no, there are no memory limitations with writing to a scrolled text widget. Internally, the text is stored in an efficient b-tree (efficient, unless all the data is a single line, since the b-tree leaves are lines). There might be a limit of some sort, but it would...

Access textbox from another class

c#,winforms,textbox

Try this - public partial class Form1 : Form { Log log; public Form1() { InitializeComponent(); log = new Log(richTextBox1); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { log.AddLog(DateTime.Now.ToString()); } private void button2_Click(object sender, EventArgs e) { log.AddLog(); } } public class...

Is it possible to do calculation in one textbox?

javascript,regex,textbox

You can use eval like $('input').keyup(function(e){ if(e.keyCode == 13) { var result = eval($(this).val()); $(this).val(result); } }); demo...

How to select the contents of a textbox once it is activated?

vba,excel-vba,events,textbox,control

Can't be more simple than this I guess... Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, _ ByVal X As Single, ByVal Y As Single) With TextBox1 .SelStart = 0 .SelLength = Len(.Text) End With End Sub Whether you click on the textbox or you tab into it,...

How can I sum value in 8 textboxes to the a single textbox?

excel,vba,excel-vba,textbox

You need to add Change Events on your text boxes that are user changeable. Lets say I have below UserForm and TextBox1 to TextBox3: TextBox3 will be the Sum of TextBox1 and TextBox2. Right click UserForm1 under Project and select View Code, then put in the TextBoxesSum Sub (I use...

Is it possible to format a Textbox for currency just in ASP NET?

asp.net,textbox,formatting,currency

You can wrap TextBox in an <asp:UpdatePanel> and add AsyncPostBackTrigger of TextChanged event. You can verify, validate and change the string from the server side using that.

Update an asp:TextBox when a asp:ListBox changes selected item

c#,asp.net,textbox,listbox

Yes, of course. That's what client side programming is for (JavaScript). When a ListBox is rendered to HTML by the server, it is converted to an HTML select element. So you can use this code: <asp:ListBox ID="myListBox" runat="server" Width="200px"></asp:ListBox> <asp:TextBox ID="myTextBox" runat="server" Width="200" /> <!-- Below we're adding the reference...

search for file and execute macro using a textbox control

excel,vba,excel-vba,textbox

SOLUTION Private Sub CommandButton1_Click() 'Set folder path where the file is located Const TDS_PATH = "C:\Users\trembos\Documents\TDS\progress\" 'Clear out any info on current page Sheets("Sheet1").Range("A2:D7557").Clear 'TextBox1.Text = ".xlsx" 'TextBox1.Font.Italic = True 'input checking If TextBox1.Text = "" Then MsgBox ("Please enter a file to search for") End If 'If the File...

Picturebox Height/Width using textbox…How?

textbox,resize,height,picturebox,weight

You'd rather affect the a variable to the Height property of your image: private void button_Click(object sender, EventArgs e) { int a = int.Parse(textbox1.Text); PublicImage.Height = a; } ...

text boxes in html form going beyond borders of form

html5,forms,css3,textbox,border

By default, an element's padding is not included in its width/height dimensions. In your example, the elements were extending beyond the parent element because there was 10px of padding on each side of the elements. 100% + 20px != 100% You could add box-sizing: border-box to the elements in order...

How Can I Make Dropdownlist act like a textbox

c#,asp.net,ajax,textbox,dropdownlistfor

I personally recommend the Select2 plugin, I have been using this in most of my project which have the same requirement as you have. Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options. Select2 Main Site...

How to copy multiple textboxes text and paste that text into other textboxes?

vb.net,textbox,copying,pasting

Using the clipboard is very likely to be the wrong approach. Instead, you could have a Class with properties for each item that you want remembered: Option Infer On ' ... Dim thingsToCopy As CopyBuffer Public Class CopyBuffer Property İSİM As String = "" Property TARİH As String = ""...

Store input number inside a variable from a textbox

ios,swift,variables,textbox

It seems like we probably simply want mmol to exist as a convenient way for getting the text property out of the mmolText textfield, right? So why not use a computed property: var mmol: String { get { return mmolText.text ?? "" } set { mmolText.text = newValue } }...

Adding line numbers to a multi-line text box

c#,winforms,textbox,line-numbers

It seems you are effectively trying to build the UI you often see in code editors (having line numbers in front). I would recommend not try to reinvent the wheel, but use an existing control for this. I often use ScintillaNET, which is a .NET wrapper around the common known...