Solved

Why isn't my string working?

Posted on 2006-06-16
8
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Six Sigma Control Plans
Progress

688 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