Solved

Why isn't my string working?

Posted on 2006-06-16
8
251 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

732 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