Visual Basic .NET ProgressBar

Join Date
Feb 2012
Location
São Paulo
Posts
53
Hello all,

I'm developing a HMI program, using VS 2005 Professional and VB .NET programmin, that will monitore a weighing process with a Beckhoff HMI with WIN CE 5.0 running on it.
All the logics are ready and working, but the ProgressBar I have in the actual program is horizontally oriented and I was now asked to do it vertically.

What I want to do is rotate my ProgressBar to fill vertically. Can anyone help me to create a new class or modify a property to make the vertical Progressbar?


Thanks in advance.
 
Not many here are VB programmers, and I haven't used it in years. Most of us rely on the higher-level programs and do not get down to the BASIC level. But I will give you a bump up, because there are a few VB guys that come to this site.
 
I would have done a decent amount of VB Programming but never on CE, if you can post some form of current code or error log I could have a look? Or Instead of using an actual Progress Bar Object could you just fill a rectangle or stretch its width in a loop to do almost the same thing?
 
Private Sub updateProgress(ByVal value As Integer)
ProgressBar1.Value = value
Dim bittMap As Bitmap = New Bitmap(ProgressBar1.Width, ProgressBar1.Height)
ProgressBar1.DrawToBitmap(bittMap, New Rectangle(0, 0, ProgressBar1.Width, ProgressBar1.Height))
bittMap.RotateFlip(RotateFlipType.Rotate90FlipNone)
PictureBox1.Image = bittMap
End Sub


ProgressBar1.Visible should be set to False
PictureBox1.Height should equal ProgressBar1.Width and vice versa
 
Private Sub updateProgress(ByVal value As Integer)
ProgressBar1.Value = value
Dim bittMap As Bitmap = New Bitmap(ProgressBar1.Width, ProgressBar1.Height)
ProgressBar1.DrawToBitmap(bittMap, New Rectangle(0, 0, ProgressBar1.Width, ProgressBar1.Height))
bittMap.RotateFlip(RotateFlipType.Rotate90FlipNone )
PictureBox1.Image = bittMap
End Sub

ProgressBar1.Visible should be set to False
PictureBox1.Height should equal ProgressBar1.Width and vice versa

AustralIan, your Sub worked fine on Windows, I did just one adjustment on "bittMap.RotateFlip(RotateFlipType.Rotate90FlipNone)" to "bittMap.RotateFlip(RotateFlipType.Rotate270FlipNone)", 'cause the 90Flip makes it increase from up to down, and I want to goes down-up.

But when I apllied it to WIN CE platform, it doesn't recognize these lines:

ProgressBar1.DrawToBitmap(bittMap, New Rectangle(0, 0, ProgressBar1.Width, _ ProgressBar1.Height))
bittMap.RotateFlip(RotateFlipType.Rotate270FlipNone)

Do you mind another way to flip the image using another class or another function?

Thanks, it's halfway I walked to finish this code.
 
But when I apllied it to WIN CE platform, it doesn't recognize these lines:

ProgressBar1.DrawToBitmap(bittMap, New Rectangle(0, 0, ProgressBar1.Width, _ ProgressBar1.Height))
bittMap.RotateFlip(RotateFlipType.Rotate270FlipNone)

Do you mind another way to flip the image using another class or another function?

Is it possible you are using .NET framework 1.1? try switching to .NET framework 2.0 [Project Properties -> References -> Change your .NET assemblies to reference v2.0 or later]

Not sure what is causing your error with rotateFlip. try System.drawing.RotateFlipType?

What specific errors are you getting?
 

Similar Topics

Hello All, I'm working on a service application to read data remotly from a SimaticNET OPC Server. All DCOM settings are correct, since I can...
Replies
1
Views
1,224
Guys, I am looking for a way to concect to a Idec OpenNet PLC with VisualBasic. I want to do this through a ActiveX, API, or Code, AKA no other...
Replies
1
Views
1,656
Dear Gentleman, Any one who know how to write programe of Visua Basic.net? I now got two forms(etc. Form1.vb and Form2.vb) in the same window...
Replies
2
Views
2,428
Hi Guys, We have a number of VB6 & 1 VB.net apps running on our production equipment. I'm interested to learn VB, basically to understand the...
Replies
3
Views
2,119
Dear experts, I am want to program RS view32 with help of Microsoft visual basic (visual basic editor). But how to start I don't know,please...
Replies
10
Views
2,392
Back
Top Bottom