?
Solved

Tank / fluid level display / control / graphic ?

Posted on 2014-04-10
8
Medium Priority
?
678 Views
Last Modified: 2014-04-14
Hey guys.  Can someone recommend a control/product that will allow me to display, graphically, the current level of a tank?  I have the data, I just need to hand it off to a control that will represent it as a pretty wizbang graphic.  Basically, picture a standing 55 gallon drum of water.  I want this graphic to show a transparent representation of the drum, with 3d/solid water inside set at the level I tell it.  Any suggestions?
0
Comment
Question by:JasonWilliam
[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
  • 3
  • 3
  • 2
8 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39993135
In what kind of application? Win Forms? ASP.NET? WPF?
0
 

Author Comment

by:JasonWilliam
ID: 39993149
Sorry, it's WinForms
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 39993878
I don't know much about 3rd-party controls, so please wait for someone else to pop in with those suggestions, but you might consider using something like the code snippet I located on the MSDN forums. Basically, it takes a regular ProgressBar control and turns it vertical instead of horizontal. Now, one side effect of this is that you get animation of the progress part by default. There are a couple of hacks that I've seen which could disable this.
CropperCapture.Gif
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.

 

Author Comment

by:JasonWilliam
ID: 39995411
Thats a thought, thanks.  Still would love to find a dedicated control though.  Anyone have any suggestions?
0
 
LVL 28

Expert Comment

by:Ark
ID: 39995631
You can use standard progressbar:
Public Class Form1
    Private Class MyTank
        Inherits ProgressBar
        Private Const PBS_VERTICAL As Integer = &H4

        Public Declare Unicode Function SetWindowTheme Lib "uxtheme.dll" (ByVal hWnd As IntPtr, ByVal pszSubAppName As String, ByVal pszSubIdList As String) As Integer
        Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
            SetWindowTheme(Me.Handle, "", "")
            MyBase.OnHandleCreated(e)
        End Sub

        Protected Overrides ReadOnly Property CreateParams() As CreateParams
            Get
                Dim cp As CreateParams = MyBase.CreateParams
                cp.Style = cp.Style Or PBS_VERTICAL
                Return cp
            End Get
        End Property
    End Class

    Private tank As MyTank, nudAmount As NumericUpDown

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        tank = New MyTank With {.Style = ProgressBarStyle.Continuous,
                                .ForeColor = Color.Blue,
                                .Location = New Point(0, 0),
                                .Size = New Size(100, 200),
                                .Maximum = 35,
                                .Value = 10,
                                .Visible = True}
        nudAmount = New NumericUpDown With {.Maximum = 35, .Value = 10, .Location = New Point(150, 10)}
        Me.Controls.Add(tank)
        Me.Controls.Add(nudAmount)
        AddHandler nudAmount.ValueChanged, AddressOf amountChanged
    End Sub

    Private Sub amountChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        tank.Value = nudAmount.Value
    End Sub

Open in new window

If you need more control on painting you can set UserPaint style and override OnPaint ( see http://emoacht.wordpress.com/2011/10/16/color-customizable-progressbar-for-visual-style/ for example)
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39995647
@Ark

I take it you didn't read my comment?
0
 
LVL 28

Expert Comment

by:Ark
ID: 39995652
Sorry I didn't. My apologize.
But I've shown how disable Visual styles as well :) - consider this as a comment, not as proposed answer.
0
 

Author Closing Comment

by:JasonWilliam
ID: 40000580
kaufmed, I'll go ahead and accept your answer.  It gets me close enough.  Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

765 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