Click here to Skip to main content
15,909,835 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Text Input Detection Pin
Absenm29-Oct-07 13:55
Absenm29-Oct-07 13:55 
GeneralRe: Text Input Detection Pin
Dave Kreskowiak29-Oct-07 14:38
mveDave Kreskowiak29-Oct-07 14:38 
GeneralRe: Text Input Detection Pin
Absenm29-Oct-07 15:30
Absenm29-Oct-07 15:30 
GeneralRe: Text Input Detection Pin
Dave Kreskowiak29-Oct-07 18:12
mveDave Kreskowiak29-Oct-07 18:12 
QuestionHow to generate serial hard disk? Pin
sovysim26-Oct-07 22:47
sovysim26-Oct-07 22:47 
AnswerRe: How to generate serial hard disk? Pin
Abhijit Jana27-Oct-07 1:20
professionalAbhijit Jana27-Oct-07 1:20 
AnswerRe: How to generate serial hard disk? Pin
Dave Kreskowiak27-Oct-07 3:43
mveDave Kreskowiak27-Oct-07 3:43 
QuestionRefreshing a drawing Pin
twsted f826-Oct-07 21:37
twsted f826-Oct-07 21:37 
Hi everyone

I got a small problem I have devloped hotel software and I am trying to draw achart that shows %age occupancy. I would like to draw a pie chart on a form. I have managed to do this so far,the chart is being drawn when the form loads.

I would like the form to be able to redraw when a user specifies a different date such that you can view the past occupancy. The code I am using is shown below. I hope you will be able to help me.

twisted F8




Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim TotalCount As Single
Dim rect As Rectangle = New Rectangle(100, 105, 150, 150)
For Each gd As GraphData In occupancy
TotalCount += gd.percentageocc
Next
Dim g As Graphics = e.Graphics
' Create variables to hold the changing values of Angles
g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
Dim StartAngle As Single = 0
Dim SweepAngle As Single = 0
For Each gd As GraphData In occupancy
SweepAngle = 360 * gd.percentageocc / TotalCount
g.FillPie(New SolidBrush(gd.Clr), rect, StartAngle, SweepAngle)
StartAngle += SweepAngle
Next
' g.DrawPie(New Pen(Color.Brown), rect, StartAngle, SweepAngle)
' Create a Brush to draw the text
Dim TextBrsh As Brush = New SolidBrush(Color.Black)
' Create a Font object instance for text display
Dim TextFont As New Font("Arial", 12, FontStyle.Bold)

g.DrawString("Chart Key", TextFont, TextBrsh, 310, 100)
Dim pxFromTop As Integer = 135

For Each gd As GraphData In occupancy
' Draw bullet
g.FillEllipse(New SolidBrush(gd.Clr), 310, pxFromTop, 15, 15)
' Draw line round bullet.
g.DrawEllipse(New Pen(Color.Black), 310, pxFromTop, 15, 15)
' Draw the text - color coded
g.DrawString(gd.Description & " (" & gd.percentageocc & "%)", TextFont, TextBrsh, 360, pxFromTop)
' Increase gap from Top for next line
pxFromTop += 30
Next
End Sub
AnswerRe: Refreshing a drawing Pin
AliAmjad27-Oct-07 2:37
AliAmjad27-Oct-07 2:37 
AnswerRe: Refreshing a drawing Pin
Luc Pattyn27-Oct-07 3:35
sitebuilderLuc Pattyn27-Oct-07 3:35 
QuestionHow to program a digital persona fingerprint scanner in VB? [modified] Pin
meki_211826-Oct-07 18:37
meki_211826-Oct-07 18:37 
AnswerRe: How to program a digital persona fingerprint scanner in VB? Pin
aransiola27-Oct-07 0:59
aransiola27-Oct-07 0:59 
GeneralRe: How to program a digital persona fingerprint scanner in VB? Pin
meki_211827-Oct-07 6:13
meki_211827-Oct-07 6:13 
GeneralRe: How to program a digital persona fingerprint scanner in VB? Pin
Dave Kreskowiak27-Oct-07 9:19
mveDave Kreskowiak27-Oct-07 9:19 
GeneralRe: How to program a digital persona fingerprint scanner in VB? Pin
aransiola27-Oct-07 9:32
aransiola27-Oct-07 9:32 
GeneralRe: How to program a digital persona fingerprint scanner in VB? Pin
meki_211828-Oct-07 3:55
meki_211828-Oct-07 3:55 
AnswerRe: How to program a digital persona fingerprint scanner in VB? Pin
Dave Kreskowiak27-Oct-07 3:41
mveDave Kreskowiak27-Oct-07 3:41 
Questionsearching a formatted Listbox Pin
iSeeGhosts26-Oct-07 16:47
iSeeGhosts26-Oct-07 16:47 
AnswerRe: searching a formatted Listbox Pin
Luc Pattyn26-Oct-07 16:59
sitebuilderLuc Pattyn26-Oct-07 16:59 
QuestionCode For Closing The One Windows Form Pin
Pavan s26-Oct-07 14:45
Pavan s26-Oct-07 14:45 
AnswerRe: Code For Closing The One Windows Form Pin
Dave Kreskowiak27-Oct-07 3:36
mveDave Kreskowiak27-Oct-07 3:36 
QuestionTDateTime (Delphi) to VB conversion Pin
Hurricane300026-Oct-07 13:02
Hurricane300026-Oct-07 13:02 
AnswerRe: TDateTime (Delphi) to VB conversion Pin
Dave Kreskowiak27-Oct-07 3:40
mveDave Kreskowiak27-Oct-07 3:40 
GeneralRe: TDateTime (Delphi) to VB conversion Pin
Hurricane300027-Oct-07 5:26
Hurricane300027-Oct-07 5:26 
QuestionSystem.Data.SqlClient.SqlDataReader has no instructor??? Pin
kc_renji26-Oct-07 8:07
kc_renji26-Oct-07 8:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.