Search Results

Search found 3025 results on 121 pages for 'textbox'.

Page 1/121 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C#: Multiline TextBox with TextBox.WordWrap Displaying Long Base64 String

    - by Peter Lee
    Hi, Happy New Year! I have a textbox to display a very long Base64 string. The TextBox.Multline = true and TextBox.WordWrap = true. The issue is caused by the auto-word-boundary detection of the TextBox itself. The Base64 string has '+' as one of the 64 characters for Base64 encoding. Therefore, the TextBox will wrap it up at the '+' character, which is not what I want (because the use might think there is a newline character around the '+' character). I just want my Base64 string displayed in Mulitline-mode in TextBox, but no word boundary detection, that is, if the TextBox.Width can only contain 80 characters, then each line should have exact 80 characters except the last line. I'm not sure if I made myself clear. Thanks. Peter

    Read the article

  • Display weekday in textbox or label using date from textbox

    - by Niels Schultz
    I have a textbox with calendar extender and a label <label for="<%= tbxFrom.ClientID %>"> From</label> <asp:Label ID="lblWeekDayFrom" runat="server"></asp:Label> <asp:TextBox ID="tbxFrom" runat="server" CssClass="Calendar"></asp:TextBox> <cc1:CalendarExtender ID="extTbxFrom" runat="server" TargetControlID="tbxStartTag"> </cc1:CalendarExtender> and now I would like to show the weekday of the currently selected date, either using a formatting inside the textbox like Th 05/20/2010 or showing the weekday as string using the label on the left side of the texbox (lblWeekDayFrom). There is a calendarExtender to select the date, but I would also like to be able to have the users enter the date manually. I tried to use JQuery to capture changes, but the label is not showing anything, and it triggers the RequiredFieldValidator on every initial page load. $(document).ready(function() { $('#<%= tbxFrom.ClientID %>').change(updateDate($('#<%= tbxFrom.ClientID %>').val())) } ); function updateDate(date) { $('#<%= lblWeekDayFrom.ClientID %>').val(date); }

    Read the article

  • cast value of a textbox to a textbox in another form

    - by simon
    I'm trying to paste the values from a textbox in form1 to textbox in form2. I did that, but while i upgraded my aplication it stopped to work. I allso need that couse i get an error(incorect data type in conditional statement) when i want to insert a value from a textbox (to a access database) that's not on the form that makes the insert statemen. the code: string textFromForm1; public Form2() { InitializeComponent(); } public void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { using (Form3 obrok = new Form3()) obrok.ShowDialog(); } private void button3_Click(object sender, EventArgs e) { this.Hide(); } private void button2_Click(object sender, EventArgs e) { } private void textBox1_TextChanged_1(object sender, EventArgs e) { } Form1 bmr=new Form1(); int masa; private void Form2_Load(object sender, EventArgs e) { textBox1.Text = bmr.masaTextBox.Text; } the code for insert statement: string conString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\Users\Simon\Desktop\save.mdb"; OleDbConnection empConnection = new OleDbConnection(conString); string insertStatement = "INSERT INTO obroki_save " + "([ID_uporabnika],[ID_zivila],[skupaj_kalorij]) " + "VALUES (@ID_uporabnika,@ID_zivila,@skupaj_kalorij)"; OleDbCommand insertCommand = new OleDbCommand(insertStatement, empConnection); insertCommand.Parameters.Add("@ID_uporabnika", OleDbType.Char).Value = users.iDTextBox.Text; insertCommand.Parameters.Add("@ID_zivila", OleDbType.Char).Value = iDTextBox.Text; insertCommand.Parameters.Add("@skupaj_kalorij", OleDbType.Char).Value = textBox1.Text; empConnection.Open(); try { int count = insertCommand.ExecuteNonQuery(); } catch (OleDbException ex) { MessageBox.Show(ex.Message); } finally { empConnection.Close(); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); }

    Read the article

  • Vertical alignment problem in textbox in MS Word 2007

    - by Surjya Narayana Padhi
    Hi, I pardon as its not a programming question at all. But if anybody can answer this it will be usefull for me. In MS word 2007 I drew a textbox and entered some text. Then I right clicked on textbox and went to format shape Then went to TextBox tab and reduced the top internal margin to 0.1 cm. But still it seems there is too much space at the top inside the textbox. I am not able to position the text exactly at the vertical middle of textbox. If I choose the auto-rezide option in format Shape, the textBox size is increases automatically but the text remains exactly at vertical and horizontal middle of textbox. but anyhow I need the textbox to be small. This is very minor but annoying problem. Can anybody help?

    Read the article

  • Vertical alignment problem in textbox in Microsoft Word 2007

    - by Surjya Narayana Padhi
    I pardon as its not a programming question at all. But if anybody can answer this it will be usefull for me. In MS word 2007 I drew a textbox and entered some text. Then I right clicked on textbox and went to format shape Then went to TextBox tab and reduced the top internal margin to 0.1 cm. But still it seems there is too much space at the top inside the textbox. I am not able to position the text exactly at the vertical middle of textbox. If I choose the auto-rezide option in format Shape, the textBox size is increases automatically but the text remains exactly at vertical and horizontal middle of textbox. but anyhow I need the textbox to be small. This is very minor but annoying problem. Can anybody help?

    Read the article

  • Vertical alignment problem in textbox in Microsoft Word 2007

    - by Surjya Narayana Padhi
    I pardon as its not a programming question at all. But if anybody can answer this it will be usefull for me. In MS word 2007 I drew a textbox and entered some text. Then I right clicked on textbox and went to format shape Then went to TextBox tab and reduced the top internal margin to 0.1 cm. But still it seems there is too much space at the top inside the textbox. I am not able to position the text exactly at the vertical middle of textbox. If I choose the auto-rezide option in format Shape, the textBox size is increases automatically but the text remains exactly at vertical and horizontal middle of textbox. but anyhow I need the textbox to be small. This is very minor but annoying problem. Can anybody help?

    Read the article

  • c# compact-framework textbox mouseleave

    - by arnoldino
    hello, I would like to leave the textbox via code. when user clicks in the textbox, and types in something , and then the user will click outside the textbox. on the screen there are just labels. only this one textbox is on the form. my problem is, that the textbox does not lost focus when I click everywhere on the screen. the texbox it still has the focus. this textbox is used to filter a list, built from labels. the complete story is: - I have no mainmenu on the screen, so the Sip icon is not visible - user clicks in the textbox, and i bring up the SIP, in the textbox.GotFocus event - user types in some letters, the list is filtered - if user clicks away, the SIP disappears (textbox.lostfocus), but the textbox still has the focus, I mean the cursor remains in the textbox - when user wants to type some other letters for filtering, it clicks in the textbox, but GotFocus does not fire how can I make the texbox to loose the focus?

    Read the article

  • Sum of two Textbox values into third Textbox using JQuery

    - by Rajneesh Verma
    A script that sums up two textbox values using jQuery. **Note that I am not using any validation for textbox values. <html xmlns= "http://www.w3.org/1999/xhtml" > <head runat= "server" > <title></title> <script type= "text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" ></script> <script type= "text/javascript" > $(function () { var textBox1 = $( 'input:text[id$=TextBox1...(read more)

    Read the article

  • Force Blank TextBox with ASP.Net MVC Html.TextBox

    - by Doug Lampe
    I recently ran into a problem with the following scenario: I have data with a parent/child data with a one-to-many relationship from the parent to the child. I want to be able to update parent and existing child data AND add a new child record all in a single post. I don't want to create a model just to store the new values. One of the things I LOVE about MVC is how flexible it is in dealing with posted data.  If you have data that isn't in your model, you can simply use the non-strongly-typed HTML helper extensions and pass the data into your actions as parameters or use the FormCollection.  I thought this would give me the solution I was looking for.  I simply used Html.TextBox("NewChildKey") and Html.TextBox("NewChildValue") and added parameters to my action to take the new values.  So here is what my action looked like: [HttpPost] public ActionResult EditParent(int? id, string newChildKey, string newChildValue, FormCollection forms) {     Model model = ModelDataHelper.GetModel(id ?? 0);     if (model != null)     {         if (TryUpdateModel(model))         {             if (ModelState.IsValid)             {                 model = ModelDataHelper.UpdateModel(model);             }             string[] keys = forms.GetValues("ChildKey");             string[] values = forms.GetValues("ChildValue");             ModelDataHelper.UpdateChildData(id ?? 0, keys, values);             ModelDataHelper.AddChildData(id ?? 0, newChildKey, newChildValue);             model = ModelDataHelper.GetModel(id ?? 0);         }        return View(report);     }    return new EmptyResult(); } The only problem with this is that MVC is TOO smart.  Even though I am not using a model to store the new child values, MVC still passes the values back to the text boxes via the model state.  The fix for this is simple but not necessarily obvious, simply remove the data from the model state before returning the view: ModelState.Remove("NewChildKey"); ModelState.Remove("NewChildValue"); Two lines of code to save a lot of headaches.

    Read the article

  • WPF- Why can't my custom textbox be selected?

    - by highone
    I have this custom textbox that I am working on and I can use it in xaml, but when I run my app I cannot select it or type in it. Here is my code: public class ModdedTextBox : TextBox { private bool selectionStartChangeFromUI; private bool selectionLengthChangeFromUI; private bool selectedTextChangeFromUI; static ModdedTextBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ModdedTextBox), new FrameworkPropertyMetadata(typeof(ModdedTextBox))); //this.SelectionChanged += this.OnSelectionChanged; //PropertyDescriptor VerticalOffsetProperty = TypeDescriptor.GetProperties(typeof(ModdedTextBox))["VerticalOffset"]; //VerticalOffsetProperty.AddValueChanged(this, this.OnVerticalOffsetChanged); } public static readonly DependencyProperty BindableSelectionStartProperty = DependencyProperty.Register( "BindableSelectionStart", typeof(int), typeof(ModdedTextBox), new PropertyMetadata(OnBindableSelectionStartChanged)); public static readonly DependencyProperty BindableSelectionLengthProperty = DependencyProperty.Register( "BindableSelectionLength", typeof(int), typeof(ModdedTextBox), new PropertyMetadata(OnBindableSelectionLengthChanged)); public static readonly DependencyProperty BindableSelectedTextProperty = DependencyProperty.Register( "BindableSelectedText", typeof(string), typeof(ModdedTextBox), new PropertyMetadata(OnBindableSelectedTextChanged)); public static readonly DependencyProperty DelayedTextProperty = DependencyProperty.Register( "DelayedText", typeof(string), typeof(ModdedTextBox), new PropertyMetadata(OnDelayedTextChanged)); public int BindableSelectionStart { get { return (int)this.GetValue(BindableSelectionStartProperty); } set { this.SetValue(BindableSelectionStartProperty, value); } } public int BindableSelectionLength { get { return (int)this.GetValue(BindableSelectionLengthProperty); } set { this.SetValue(BindableSelectionLengthProperty, value); } } public string BindableSelectedText { get { return (string)this.GetValue(BindableSelectedTextProperty); } private set { this.SetValue(BindableSelectedTextProperty, value); } } public string DelayedText { get { return (string)this.GetValue(DelayedTextProperty); } private set { this.SetValue(DelayedTextProperty, value); } } private static void OnBindableSelectionStartChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { var textBox = dependencyObject as ModdedTextBox; if (!textBox.selectionStartChangeFromUI) { int newValue = (int)args.NewValue; textBox.SelectionStart = newValue; } else { textBox.selectionStartChangeFromUI = false; } } private static void OnBindableSelectionLengthChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { var textBox = dependencyObject as ModdedTextBox; if (!textBox.selectionLengthChangeFromUI) { int newValue = (int)args.NewValue; textBox.SelectionLength = newValue; } else { textBox.selectionLengthChangeFromUI = false; } } private static void OnBindableSelectedTextChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { var textBox = dependencyObject as ModdedTextBox; if (!textBox.selectedTextChangeFromUI) { string newValue = (string)args.NewValue; textBox.BindableSelectedText = newValue; } else { textBox.selectedTextChangeFromUI = false; } } private static void OnDelayedTextChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { } private void OnSelectionChanged(object sender, RoutedEventArgs e) { if (this.BindableSelectionStart != this.SelectionStart) { this.selectionStartChangeFromUI = true; this.BindableSelectionStart = this.SelectionStart; } if (this.BindableSelectionLength != this.SelectionLength) { this.selectionLengthChangeFromUI = true; this.BindableSelectionLength = this.SelectionLength; } if (this.BindableSelectedText != this.SelectedText) { this.selectedTextChangeFromUI = true; this.BindableSelectedText = this.SelectedText; } } private void OnVerticalOffsetChanged(object sender, EventArgs e) { MessageBox.Show("hello the vertical offset works"); } }

    Read the article

  • Disable Drag-drop from TextBox

    - by viky
    I have a WPF textBox that is declared as ReadOnly <TextBox IsReadOnly="True" IsTabStop="False" Width="200" /> So, User can not write anything into the TextBox or delete the content but it still allows user to drag the text from this textbox and drop it in any other textbox that caused the text removed from the first textbox(the read-only one) and thats unexpected. Is it a bug? how can I get rid of this?

    Read the article

  • Hide overflow in Silverlight TextBox

    - by chrisbz
    I have a Silverlight TextBox control that is inside of a Grid column with the width set to 'Auto', so the TexBox's width expands/contracts with the browser window is resized. Unfortunately, when the number of characters entered into the textbox exceeds the textbox's width, the textbox grows to accommodate it. Are there any properties that can be applied to the textbox that will force it to not expand with the number of characters inside of it? Thanks.

    Read the article

  • WPF TextBox.SelectAll () doesn't work

    - by Zoliq
    Hi! I have used the following template in my project: <DataTemplate x:Key="textBoxDataTemplate"> <TextBox Name="textBox" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" Tag="{Binding}" PreviewKeyDown="cellValueTextBoxKeyDown"> <TextBox.Text> <MultiBinding Converter="{StaticResource intToStringMultiConverter}"> <Binding Path="CellValue" Mode="TwoWay"> <Binding.ValidationRules> <y:MatrixCellValueRule MaxValue="200" /> </Binding.ValidationRules> </Binding> <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type y:MatrixGrid}}" Path="Tag" Mode="OneWay" /> </MultiBinding> </TextBox.Text> </TextBox> </DataTemplate> I used this template to create an editable matrix for the user. The user is able to navigate from cell to cell within the matrix and I would like to highlight the data in the selected textbox but it doesn't work. I called TextBox.Focus () and TextBox.SelectAll () to achieve the effect but nothing. The Focus () works but the text never gets highlighted. Any help is welcome and appreciated.

    Read the article

  • C# How to commit a TextBox?

    - by Jake
    Hi, In a form, I have a TextBox Binding an Object on its member property "Title". Along with it is a "Save" button to test the binding. Seems like the underlying object property does not get updated unless the textbox loses focus. But there no form.ActiveControl.Blur() for use. Besides, this does not seem like a sound hack. Anyway to do this better? Thanks. EDIT: Sorry for not being clear. My question is in the title: "How to commit a TextBox". I use the term "commit" from the DataGridView commit and BindingSource commit. And it's in WinForms. (Have never worked with WPF, so it didn't occur to me. Sorry). The actual scenario I have is I have a bunch of TextBox binded to property of a single Object. The user enters values in all the TextBox and when the user clicks save (toolbar button), the last TextBox is still in focus (or in editing mode) hence the save will not capture the last value in the last textbox. I want to find the correct way to "commit" the textbox value just before saving. Thanks.

    Read the article

  • Why isn't TextBox.Text in WPF animatable?

    - by cplotts
    Ok, I have just run into something that is really catching me off-guard. I was helping a fellow developer with a couple of unrelated questions and in his project he was animating text into some TextBlock(s). So, I went back to my desk and recreated the project (in order to answer his questions), but I accidentally used TextBox instead of TextBlock. My text wasn't animating at all! (A lot of help, I was!) Eventually, I figured out that his xaml was using TextBlock and mine was using TextBox. What is interesting, is that Blend wasn't creating key frames when I was using TextBox. So, I got it to work in Blend using TextBlock(s) and then modified the xaml by hand, converting the TextBlock(s) into TextBox(es). When I ran the project, I got the following error: InvalidOperationException: '(0)' Storyboard.TargetProperty path contains nonanimatable property 'Text'. Well, it seems as if Blend was smart enough to know that ... and not generate the key frames in the animation (it would just modify the value directly on the TextBox). +1 for Blend. So, the question became: why isn't TextBox.Text animatable? The usual answer is that the particular property you are animating isn't a DependencyProperty. But, this isn't the case, TextBox.Text is a DependencyProperty. So, now I am bewildered! Why can't you animate TextBox.Text? Let me include some xaml to illustrate the problem. The following xaml works ... but uses TextBlock(s). <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="TextBoxTextQuestion.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480" > <Window.Resources> <Storyboard x:Key="animateTextStoryboard"> <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Text)" Storyboard.TargetName="textControl"> <DiscreteStringKeyFrame KeyTime="0:0:1" Value="Goodbye"/> </StringAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource animateTextStoryboard}"/> </EventTrigger> </Window.Triggers> <Grid x:Name="LayoutRoot"> <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="textControl" Text="Hello" FontFamily="Calibri" FontSize="32"/> <TextBlock Text="World!" Margin="0,25,0,0" FontFamily="Calibri" FontSize="32"/> </StackPanel> </Grid> </Window> The following xaml does not work and uses TextBox.Text: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="TextBoxTextQuestion.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480" > <Window.Resources> <Storyboard x:Key="animateTextStoryboard"> <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBox.Text)" Storyboard.TargetName="textControl"> <DiscreteStringKeyFrame KeyTime="0:0:1" Value="Goodbye"/> </StringAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource animateTextStoryboard}"/> </EventTrigger> </Window.Triggers> <Grid x:Name="LayoutRoot"> <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBox x:Name="textControl" Text="Hello" FontFamily="Calibri" FontSize="32"/> <TextBox Text="World!" Margin="0,25,0,0" FontFamily="Calibri" FontSize="32"/> </StackPanel> </Grid> </Window>

    Read the article

  • Set focus on textbox after postback.

    - by Niike2
    I have a search page with 3 TextBoxes that users can filter a search with. I have put the focus on the TextBox that contains text. If more than one contains text just focus on last TextBox. private void SetFocusOnTextBox(ControlCollection ctrlCollection) { foreach (Control ctrl in ctrlCollection) { if (ctrl.GetType() == typeof(TextBox)) { if (((TextBox)ctrl).Text != string.Empty) { SetFocus(ctrl); } } } } After the code runs and a user searches, the focus comes to the beginning of the TextBox, not the end where it would be presumed. How to put insert marked at the end of that TextBox?

    Read the article

  • WPF Textbox & Borders - curious resizing behavior

    - by CitizenParker
    The following XAML produces a window with strange behavior around the textbox: <Window x:Class="WpfSandbox.CuriousExample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="CuriousExample" Height="300" Width="300"> <DockPanel Margin="15"> <TextBox BorderThickness="1" BorderBrush="#FF000000"></TextBox> </DockPanel> </Window> What happens, at least during my limited testing, is that the textbox renders with an inset border pattern (top/left is black, right/bottom is grey). However, when you resize to any position except the original, the entire textbox border goes to black. Whenever you return the window to the exact number of on-screen pixels the form had when it first loaded, it's inset again. I'm guessing it isn't pixel snapping as I can easily correct the problem with this code: <Window x:Class="WpfSandbox.CuriousExample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="CuriousExample" Height="300" Width="300"> <DockPanel Margin="15"> <Border BorderThickness="1" BorderBrush="#FF000000"> <TextBox BorderThickness="0" ></TextBox> </Border> </DockPanel> </Window> Anyone care to venture an explanation as to what I'm seeing? Or is it all in my head? Like I said, the above workaround can resolve this problem - just trying to understand what is happening here. Thanks, -Scott

    Read the article

  • Retrieve a TextBox element dinamically created and Focus it

    - by user335444
    Hi, I have a collection (VariableValueCollection) of custom type VariableValueViewModel objects binded with a ListView. WPF Follow: <ListView ItemsSource="{Binding VariableValueCollection}" Name="itemList"> <ListView.Resources> <DataTemplate DataType="{x:Type vm:VariableValueViewModel}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="180"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBox TabIndex="{Binding Path=Index, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Grid.Column="0" Name="tbValue" Focusable="True" LostFocus="tbValue_LostFocus" GotFocus="tbValue_GotFocus" KeyDown="tbValue_KeyDown"> <TextBox.Text> <Binding Path="Value" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay"> <Binding.ValidationRules> <ExceptionValidationRule></ExceptionValidationRule> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> </Grid> </DataTemplate> </ListView.Resources> </ListView> My Goal is to add a new row when I press "enter" on last row, and Focus the new row. To do that, I check that row is the last row and add a new row in that case. But I don't know how to focus the new TextBox... Here the KeyPressed method: private void tbValue_KeyDown(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { DependencyObject obj = itemList.ContainerFromElement((sender as TextBox)); int index = itemList.ItemContainerGenerator.IndexFromContainer(obj); if( index == (VariableValueCollection.Count - 1) ) { // Create a VariableValueViewModel object and add to collection. In binding, that create a new list item with a new TextBox ViewModel.AddNewRow(); // How to set cursor and focus last row created? } } } Thank's in advance...

    Read the article

  • How create a Firefox-like search textbox in WPF?

    - by Simon
    Hey there. I'm writing an application in WPF using the MVVM-pattern and will really often use TextBoxes. I don't want to use labels for the user to know user what the text box is for, i.e. I don't want something like this: <TextBlock> Name: </TextBlock> <TextBox /> Instead, I would like the TextBox to contain its own label. Statically, you would express it like this: <TextBox>Name</TextBox> If the cursor is displayed in the textbox, i.e. the TextBox gains focus, I want the description text to disappear. If the TextBox is left empty and it loses the focus, the description text should be shown again. It's similar to the search textbox of StackOverflow or the one of Firefox. (please tell me if your not sure what I mean). One TextBox's label may change at runtime, dependending on e.g. a ComboBox's selected element or a value in my ViewModel. (It's like in Firefox's search TextBox, if you select google from the search engins' menu, the TextBox's label changes to "Google", if you select "Yahoo" its set to "Yahoo"). Thus I want to be able to bind the label's content. Consider that I may already have a Binding on the Text-Property of the TextBox. How can implement such a behaviour and make it reusable for any of my TextBox's? Code is welcome but not needed; a description of what to do is enough. Thank you in advance.

    Read the article

  • Disable a textbox using CSS

    - by Balaji
    How to disable a textbox in CSS? Currently we are having a textbox in our view which can be enabled/disabled depending on a property in the model. We are having asp.net MVC view; depending on the value of the Model property we need to either render a textbox or readonly textbox. we were thinking of doing this by applying CSS to the view control. Has someone done this earlier?

    Read the article

  • Allow users to insert a TAB into a TextBox but not newlines

    - by pbean
    I want to have a TextBox which does accept the TAB key (and places a TAB, ASCII 0x09, \t accordingly into the textbox) instead of jumping to the next control. The TextBox has a property AcceptsTab, which I have set to true but this does not give the desired result. It turns out the AcceptsTab property only works then Multiline is set to true as well. However I want to have a one-line TextBox which doesn't accept newlines.

    Read the article

  • Autoresize textbox control vertically

    - by andrew
    In a C# form, i have a panel anchored all sides, and inside, a textbox, anchored top/left/right. When text gets loaded into the textbox, i want it to auto expand itself vertically so that i don't need to scroll the textbox (scroll the panel at most, if there is more text that doesn't fit the panel). is there any way to do this with a textbox? (i'm not constrained to use this control so if there's another control that fits the description, feel free to mention it)

    Read the article

  • Binding "Text-Property" of a derived textbox to another textbox doesn´t work

    - by Jehof
    Hello, i have a class 'MyTextBox' that derives from the default TextBox in Silverlight. This class currently contains no additional code. I set up a binding in xaml to bind the Text-Property of MyTextbox to another Textbox to reflect the input made in the Textbox. The effect is that MyTextBox doesn´t update and not display the text of the other Textbox. Additional i made an equal binding for a normal Textbox. And this works. Here´s the XAML for the bindings. <UserControl x:Class="Silverlight.Sample.Dummy" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:Sample" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <StackPanel x:Name="LayoutRoot" Background="White"> <TextBox Height="23" x:Name="textBox2" Width="120" /> <TextBox Text="{Binding ElementName=textBox2, Path=Text, Mode=TwoWay}" Width="120" /> <my:NumberTextBox Width="120" Text="{Binding ElementName=textBox2, Path=Text, Mode=OneWay}" /> </StackPanel> Is there something special to set for binding, when i derive from a control. PS: I tried a binding to a dummy object with INotifyPropertyChanged and set it as DataContext for the existing Textboxes. This test works as expected and my derived textbox gets updated.

    Read the article

  • Paste Event in a WPF TextBox

    - by code-zoop
    I have created a custom control inheriting TextBox. This custom control is a numeric TextBox, only supporting numbers. I am using OnPreviewTextInput to check each new character being typed to see if the character is a valid input. This works great. However, if I paste the text into the TextBox, OnPreviewTextInput is not fired. What is the best way to capture pasted text in a TextBox? Also, I have a problem when the back space is pressed, I can't figure out what event this will fire. OnPreviewTextInput is not fired! any ideas how to capture pasted text and back space events in WPF TextBox? Thanks

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >