This is a discussion on Label Question within the C# Programming forums, part of the Software Development category; Label Question Hi, i want to get a code were when i load something in a textbox i have another ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Label Question Hi, i want to get a code were when i load something in a textbox i have another label tht is like 0/0 and when i load something in textbox in will show up like 0/100 or how ever many lines are being used.....for example if i have 150 lines being used i want it to show 0/150...on vb8 plz..ty
__________________ A.Rajesh Khanna |
|
#2
| |||
| |||
| Hi, i am writing the following code for your reference. Me.TextBox1.Text = "aaaaaaaaaaaabbbbbbbbbbbbbbbbbbb" + Environment.NewLine Me.TextBox1.Text += "bbadfadfasdfdsfdsfdfdfsafdsfd" + Environment.NewLine Dim str As String = String.Format("0/{0}", TextBox1.Lines.Count.ToString()) Me.Label1.Text = str If you have any problem regarding the code , please feel free to let me know.
__________________ Shaalini.S ![]() Be the Best of Whatever you are... |
|
#3
| |||
| |||
| Hi all, wht do i put code under....textbox...label or the load button
__________________ A.Rajesh Khanna |
|
#4
| |||
| |||
| Hi , You can put the code in the place as you need. For example, if you want the label to show the string when the form is loading, you can put this in the Load event handler of the Form. Else if you want the label to show the string when the button is clicked, you can put the code in a button clicked event handler. If you want the text in the Lable change when you input in the TextBox, then you may need to put the code in the KeyPress or TextChanged event handler of the TextBox.
__________________ Shaalini.S ![]() Be the Best of Whatever you are... |
|
#5
| |||
| |||
| Hi, thanks and is there also a way when you load something in the textbox to have the first one highlighted so when you run it you dont have to click it
__________________ A.Rajesh Khanna |
|
#6
| |||
| |||
| Hi all, I think you want partial Text of TexBox highlighted when the form is loaded. You can set the SelectionStart property and SelectionLength property to achieve the goal. Here is the code: Me.TextBox1.Text = "How's your problem now?"+Environment.NewLine; Me.TextBox1.Text +="Yes, it's Ok now. Thank you very much"; Me.TextBox1.SelectionStart = 0; Me.TextBox1.SelectionLength = 5;
__________________ Shaalini.S ![]() Be the Best of Whatever you are... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mac OS X question | ventyra | Operating Systems | 1 | 12-17-2007 07:48 PM |
| question | iyyappan | Flash Actionscript Programming | 3 | 12-06-2007 12:45 AM |
| create Editable label without postback | shaalini | ASP and ASP.NET Programming | 4 | 10-18-2007 01:18 AM |
| css question | muthukumar | HTML, CSS and Javascript Coding Techniques | 0 | 07-17-2007 11:02 AM |
| SEO Question | nhoj | Search Engine Optimization | 6 | 04-26-2007 11:03 PM |
Our Partners |