|
-
Jun 6th, 2010, 02:29 PM
#1
Thread Starter
Lively Member
ToolStripStatusLabel
Hi all,
Me...again 
My next problem is the following one...I have a ToolStripStatusLabel and it is set to ImageAndText. But I want to change the image at runtime.
Depending whether the data is up-to-date or not.
So if the data is up-to-date I want to see a green V , if not a ! sign
At this moment I have this, but it doesn't seem to work 
Code:
Select Case diffday
Case Is < 0
Main.DAFIF_txt.ForeColor = Color.Red
Main.DAFIF_txt.Text = "DAFIF Outdated"
Main.DAFIF_txt.Image = Image.FromFile(domain_path & "Grafix\DAFIF_NOK.png")
Case Else
Main.DAFIF_txt.ForeColor = Color.Green
Main.DAFIF_txt.Text = "DAFIF valid till " & DateTime.FromOADate(enter_datum)
Main.DAFIF_txt.Image = Image.FromFile(domain_path & "Grafix\DAFIF_OK.png")
End Select
Thanks in advance
-
Jun 6th, 2010, 03:05 PM
#2
Lively Member
Re: ToolStripStatusLabel
Can you confirm that your domain_path ends with a "\". I had a similar problem and that was the culprit.
-
Jun 6th, 2010, 07:04 PM
#3
Re: ToolStripStatusLabel
 Originally Posted by wearmc
Can you confirm that your domain_path ends with a "\". I had a similar problem and that was the culprit.
If you use the Path.Combine method then you don't have to worry about that because it will work either way. This:
vb.net Code:
Main.DAFIF_txt.Image = Image.FromFile(IO.Path.Combine(domain_path, "Grafix\DAFIF_NOK.png"))
will work whether 'domain_path' ends with a slash or not.
-
Jun 6th, 2010, 07:05 PM
#4
Re: ToolStripStatusLabel
 Originally Posted by Geemuse
Hi all,
Me...again
My next problem is the following one...I have a ToolStripStatusLabel and it is set to ImageAndText. But I want to change the image at runtime.
Depending whether the data is up-to-date or not.
So if the data is up-to-date I want to see a green V , if not a ! sign
At this moment I have this, but it doesn't seem to work
Code:
Select Case diffday
Case Is < 0
Main.DAFIF_txt.ForeColor = Color.Red
Main.DAFIF_txt.Text = "DAFIF Outdated"
Main.DAFIF_txt.Image = Image.FromFile(domain_path & "Grafix\DAFIF_NOK.png")
Case Else
Main.DAFIF_txt.ForeColor = Color.Green
Main.DAFIF_txt.Text = "DAFIF valid till " & DateTime.FromOADate(enter_datum)
Main.DAFIF_txt.Image = Image.FromFile(domain_path & "Grafix\DAFIF_OK.png")
End Select
Thanks in advance
Define "doesn't seem to work". Is there an error message? If so, that's information relevant to our solving the problem. If there isn't, exactly what does happen?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|