Visual Basic -08 Textbox

How to get a textbox to display...

Page 1 of 1

3 Replies - 1486 Views - Last Post: 05 December 2008 - 04:10 AM Rate Topic: -----

#1 Zooms  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 78
  • Joined: 04-December 08

Visual Basic -08 Textbox

Posted 05 December 2008 - 12:10 AM

Hi, just started here, so this is my first post :)

But anyways, i want a textbox to display a certain word or sentance when
a progressbar is in, for example, value 12. This ive been having some
problem with on how to get it to work.

The code to display pop ups on a certain value, just an example is:
If ProgressBar1.Value = "100" Then
Msgbox("Complete")


The above code is the one i think you have to use, just need to know
how to get it to write it in a textbox :)

Is This A Good Question/Topic? 0
  • +

Replies To: Visual Basic -08 Textbox

#2 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Visual Basic -08 Textbox

Posted 05 December 2008 - 12:42 AM

The Value Property of a ProgressBar is an Integer and not a String.
Change your code to:
If ProgressBar1.Value = 12 Then
   txtBoxName.Text = "ProgressBar reached Value 12"
End If


Usually when you write such code, you check for a range rather than a single value. This is because (depending on the code to implement an operation) the code might increment the progressbar by a value greater than 1. In such a case, if the previous value of the progress bar was 10 and an increment of 5 was given, the number 12 would be skipped and so would the code block within the if statement.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Visual Basic -08 Textbox

Posted 05 December 2008 - 03:33 AM

Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

#4 Zooms  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 78
  • Joined: 04-December 08

Re: Visual Basic -08 Textbox

Posted 05 December 2008 - 04:10 AM

View Postborn2c0de, on 4 Dec, 2008 - 11:42 PM, said:

The Value Property of a ProgressBar is an Integer and not a String.
Change your code to:
If ProgressBar1.Value = 12 Then
   txtBoxName.Text = "ProgressBar reached Value 12"
End If


Usually when you write such code, you check for a range rather than a single value. This is because (depending on the code to implement an operation) the code might increment the progressbar by a value greater than 1. In such a case, if the previous value of the progress bar was 10 and an increment of 5 was given, the number 12 would be skipped and so would the code block within the if statement.


Thanks, really needed it :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1