Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Why isn't my string working?

Posted on 2006-06-16
8
Medium Priority
?
265 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 21

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 21

Accepted Solution

by:
alainbryden earned 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

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

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 21

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Simple Linear Regression

604 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