473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB6 Contents for text into label

104 100+
Hi there and a happy new year to all. I have a label and a few text boxes. The label is set to scroll the info from the textboxes. It is easy to link 1 textbox to a label, but I want to label to read from a few textboxes in sequence. and scroll the info from those text boxes.

Herewith my code:
frmSplash.Label50.Caption = Player1.Text1.Text Then Player1.Text2.Text

My problem is how to identify the next "textbox" in the sequence? I have used the Then function as i have no idea what should be used or if it is possible. I have tried "then" "," "next" between the 2 identified textboxes with no luck. Can anyone help please.

Thanks
Werner
Jan 1 '08 #1
4 1459
QVeen72
1,445 Expert 1GB
Hi,

Keep an Array which contains names of all the TextBox in a Sequential manner, Say MyArr(0) = "Text1", MyArr(1) = "NewTextBox"..
And a Form Level Variable, To Check the Current Index.
So depending on the Index, Set the Next TextBox,
To Go to Next TextBox :

Expand|Select|Wrap|Line Numbers
  1. Dim T1 As TextBox
  2. MyIndex = MyIndex+1
  3. If MyIndex >= UBound(MyArr) Then MyIndex =0    'Repeat here
  4. Set T1 = MyArr(MyIndex)...
  5. ' Write here code to populate from T1
  6.  
Regards
Veena
Jan 1 '08 #2
Killer42
8,435 Expert 8TB
... frmSplash.Label50.Caption = Player1.Text1.Text Then Player1.Text2.Text

My problem is how to identify the next "textbox" in the sequence? I have used the Then function as i have no idea what should be used or if it is possible. I have tried "then" "," "next" between the 2 identified textboxes with no luck. Can anyone help please.
You use "&" or "+" to concatenate them into a single string.

Then is not a function. It is the part of the If statement which indicates what to run if the condition is true.
Jan 1 '08 #3
Wernerh
104 100+
Thanks Killer42, that was the simple answer i was looking for, just another question to that. My result is working perfectly, but obviously now reads like this : MarkJohn How do I indentify spaces example Mark John. Thanks again

My code :
frmSplash.Label50.Caption = Player1.Text1.Text & Player1.Text2.Text
Jan 1 '08 #4
Killer42
8,435 Expert 8TB
Just keep in mind, you can use & to concatenate any strings, including spaces or whatever you want.
Jan 2 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: rob | last post by:
Hello, I would like to create a VB.net program that can grab the text/contents inside a control (like a label control) in an external program (one I didnt make). The scenario is this: The...
15
by: Lee | last post by:
Often times, I do not want to specify the width of a div. Rather, I just want it to expand to be just wide enough to enclose its contents. Since this is how tables behave, I tried setting "div...
2
by: shail | last post by:
Sir, I have a label control in web form, I want to adjust its height according to the contents in it which are generated dynaically and I want other controls position should readjust according to...
6
by: Matthew | last post by:
I have a label that displays the output of my program. I want to make the label very close to the size of the text it contains. The problem is the text changes. So, can I dynamically resize the...
1
by: David | last post by:
Hi, This one appears a little strange to me. Here is the scenario. I load a datalist the first time a page is run. The page has a !IsPostback and the datalist gets loaded at this point. I...
4
by: bgruha | last post by:
Hi I have a text area and a label. label(cntfieldld) represents the number of characters that still can be entered in the text area(xtxExpertise). I have written the following code: ...
6
ak1dnar
by: ak1dnar | last post by:
Hi, I have created Sub in VB.net application, Which reads a text file contents. Sub IPsetter() Dim fileName As String Dim realIParray As String() = Nothing Dim...
14
by: jehugaleahsa | last post by:
I have a rather complex need. I have a class that parses web pages and extracts all relevant file addresses. It allows me to download every pdf on a web page, for instance. I would like to...
6
by: Feivi18 | last post by:
Hi everyone, new user here. I've been finding it harder and harder to get answers at EE for certain questions, and am hoping someone here will be able to help me! Using asp.net and c#, my site...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.