Solved

Why isn't my string working?

Posted on 2006-06-16
8
235 Views
Last Modified: 2010-04-17
I'm building a string with another string and a datetime value.



            Agent = MainForm.gridActiveEvent.Item(RandomNumber, 4)
            EventCode = MainForm.gridActiveEvent.Item(RandomNumber, 2)
            EventName = MainForm.gridActiveEvent.Item(RandomNumber, 1)
            EventInstance = MainForm.gridActiveEvent.Item(RandomNumber, 0)
            EventDate = MainForm.gridActiveEvent.Item(RandomNumber, 3)
         
            EventNameandDate = EventName.ToString & ":" & EventDate.ToString
            ' MsgBox(EventNameandDate)
            If EventName = Nothing Then
                ELabel.Text = "Non-Found"
            Else
               
                ELabel.Text = EventNameandDate
            End If



the msgbox you see above will display both perfectly. However the Date/Time won't show up when put on my label. Also if I reverse the order of the strings I can get the date to show up but the eventname will not show up. Come on genuises any ideas? Probably something simple. haha
0
Comment
Question by:JPERKS1985
  • 4
  • 4
8 Comments
 
LVL 20

Expert Comment

by:alainbryden
ID: 16925284
Hey Jperks!

I believe the answer you are looking for is to add Elable.refresh right after you set the property.

If this fails, then you will need to check the properties of the label and make sure that it is set to expand to the contents.
0
 
LVL 20

Accepted Solution

by:
alainbryden earned 500 total points
ID: 16925297
*Elabel.refresh, sorry I spelled it wrong.

Oh the property you should check on is

Elabel.Autosize = true
Elabel.WordWrap = false    will probably help too

Hope this solves your problem. If this is it, it seems sort of weird that it would half work in reverse, but I'm sure it isn't a format problem.


If none of my suggestions work, then sometimes plugging in a ' DoEvents ' solves all your freezing and updating problems.
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 16925332
hmmm, still can't get it working. refresh wouldn't work and strings that vary in size will fit in it. this is a very odd problem.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 1

Author Comment

by:JPERKS1985
ID: 16925360
Works good thanks man.
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 16925373
I guess DoEvents solved it?
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 16925387
it was autosize actually.
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 16925399
for some reason it feels the need to put each string on a new row in the label? even though their not to long.
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 16925570
heh, oh yeah. You get that when the default size of the label is small, it will only get as big as it has to for one word, then try to save horizontal space by wrapping to the next line. You'd think wordwrap would cover a problem like that :P
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question