Solved

Why isn't my string working?

Posted on 2006-06-16
8
210 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
Comment Utility
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
Comment Utility
*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
Comment Utility
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
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
Works good thanks man.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 20

Expert Comment

by:alainbryden
Comment Utility
I guess DoEvents solved it?
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
it was autosize actually.
0
 
LVL 1

Author Comment

by:JPERKS1985
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
userCompare  challenge 3 61
Replace a tag with sed 2 41
topping3 challenge 14 48
C Programming - If Statement 8 47
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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.
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now