Devenir membre club
Connectez vous
Aide & règlement
Votre 1ère visite
Le règlement
Contacter les admins
Contacter le webmaster
Questions & réponses
Comment soutenir CodeS-SourceS
Comment faire un lien vers CodeS-SourceS
Autres questions
A propos & don
A propos du réseau
Les modérateurs
Remerciements
Faire un don
Le livre d'or
Tous les livres
Les dernières parutions
Les plus consultés
Les critiques
Le top des ventes
Le top favoris des membres
Recevoir des livres blancs
Tous les thèmes
Les derniers messages
Les nouveaux messages
Poser une question
Le Chat - IRC
Tous les tutoriels
Ajouter un tutoriel
Les tutoriels en vidéo
Les formations vidéos
Tous les codes
Ajouter un code
Filtrer par catégorie
Filtrer par date
Les plus récents
Les mis à jour
Les codes par jour
Filtrer par niveau
Niveau débutant
Niveau initié
Niveau expert
Filtrer par type
Les codes avec capture
Les codes avec zip
Les codes .Net
Filtrer par qualité
Les plus populaires
Les plus populaires du mois
Les plus téléchargés
Les mieux notés
Top par catégorie
Top des favoris
Filtrer par auteur
Tous les auteurs
Le top des membres
Les snippets
Déposer votre CV
Consulter les offres d'emploi ou de stage
Consulter les CVs
Déposer une offre d'emploi ou de stage
Modèles de CV et lettres
Trouver une convention collective
Les écoles d'informatique
Toutes les écoles
Ajouter une école
Les outils
Outils pour développeurs
Trouver des ressources
Base de données de CodeS-SourceS
Télécharger les meilleurs logiciels
Comparer les prix
Envoyer des ecards
Création de bannières
Annuaire de la prog
Tous les sites
Ajouter votre site
Le dico de la prog
Toutes les définitions
Ajouter une définition
Les évènements
Tous les évènements
Les évènements à venir
Ajouter un évènement
Téléchargements
CodeS-SourceS Toolbox
CodeS-SourceS Toolbar
Toolbar pour FireFox
Fonds d'écran
Les compil's
Nos partenaires
Magazine Programmez
Frontier.fr
Xiti
ProgOnline
Winwise
Editions Eyrolles
Toute la liste
Les RFC
CS
VB, VB.NET
ASP.NET,ASP
C, C++
ColdFusion
PHP
Javascript
Delphi
Flash
Java
Graphisme
Irc
Assembleur
C#
Mobilité
SQL
Foxpro
Python
Regex
Flex
Windev
Ce site au démarrage
begin process at 2010 03 21 12:54:15
Accueil
Codes
Tutoriels
Forum
Livres
Emploi
Services
Connexion
Trouver un code source :
dans
Tout le site
Codes
Tutoriels
Forum
Blogs
Livres
RFC
Icones
News .NET
Boutique
[ Dernières recherches ]
Veuillez saisir votre recherche... Ex: smtp, lire un fichier, rs232
Options de recherche :
Tous les codes
Tous les codes en .Net
Tous les codes sauf .Net
Langages disponibles :
Tous les langages
ASP / ASP.NET
Assembleur
C / C++ / C++.NET
C# / C#.NET
ColdFusion
Delphi
Flash
Flex, Air, ActionScript
Foxpro
Graphisme
IRC
JAVA / J2EE
Javascript / Ajax / DHTML
PDA / PocketPC
PHP
Python
Regex, Regular Expression, Expression régulière
SQL
Visual Basic, VB6, VB.NET, VB 2005, VB
7 commentaire(s) de dedebatou
sur des sources sur tout
CodeS-SourceS
Déposé sur
Courbe 2d sans mschart
Voici le module Graph.vb corrigé pour accepter les valeurs négatives:
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class graph
Public chartdata(0, 0) As Object
Public CourbeVisible(100) As Boolean
Public barVisible(100) As Boolean
Public CurseurVisible(100) As Boolean
Public ValeurMoyenne(100) As Boolean
Public PenCourbe(100) As Pen
Public Image As Bitmap
Private PenAxe As New Pen(Color.Black, 2)
Private PenGrill As New Pen(Color.Gray, 0)
Private BrushTitre As Brush = Brushes.Black
Private Bcolor As Color = Color.White
Private ombre As Color = Color.LightGray
Private ovisible As Boolean = True
Private Penombre As New Pen(Color.LightGray, 2)
Private colorgrill As Color = Color.Gray
Private colortitre As Color = Color.Black
Private coloraxe As Color = Color.Black
Private BcolorGrill As Color = Color.White
Private FontY As Font = New System.Drawing.Font("MicrosoFontTitre Sans Serif", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private FontX As Font = New System.Drawing.Font("MicrosoFontTitre Sans Serif", 8.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private FTitre As Font = New System.Drawing.Font("MicrosoFontTitre Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Private titre As String = "Titre"
Private naxex As String = ""
Private naxey As String = ""
Private mb As Integer = 100
Private mh As Integer = 40
Private ml As Integer = 50
Private ex As Integer
Private ey As Integer
Private ny As Integer
Private gg As Graphics
Private orientX As Boolean
Private nbc As Integer = 2
Private nbe As Integer = 1000
Private rcontrole As Rectangle
Private rgraph As Rectangle
Private pvisible As Boolean = True
Private zoom As Boolean
Private ccontour As Color = Color.Black
Private cvisible As Boolean
Private moy(100) As Double
Private vmin As Integer
Public ReadOnly Property Moyenne(ByVal n As Integer) As Double
Get
Return moy(n)
End Get
End Property
Public Property CouleurContour() As Color
Get
Return ccontour
End Get
Set(ByVal value As Color)
ccontour = value
Me.Refresh()
End Set
End Property
Public Property ContourVisible() As Boolean
Get
Return cvisible
End Get
Set(ByVal value As Boolean)
cvisible = value
Me.Refresh()
End Set
End Property
Public Property ZoomActif() As Boolean
Get
Return zoom
End Get
Set(ByVal value As Boolean)
zoom = value
End Set
End Property
Public Property NomAxeX() As String
Get
Return naxex
End Get
Set(ByVal value As String)
naxex = value
End Set
End Property
Public Property NomAxeY() As String
Get
Return naxey
End Get
Set(ByVal value As String)
naxey = value
End Set
End Property
Public Property FontAxeX() As Font
Get
Return FontX
End Get
Set(ByVal value As Font)
FontX = value
Me.Refresh()
End Set
End Property
Public Property FontAxeY() As Font
Get
Return FontY
End Get
Set(ByVal value As Font)
FontY = value
Me.Refresh()
End Set
End Property
Public Property FontTitre() As Font
Get
Return FTitre
End Get
Set(ByVal value As Font)
FTitre = value
Me.Refresh()
End Set
End Property
Public Property CouleurAxe() As Color
Get
Return coloraxe
End Get
Set(ByVal value As Color)
coloraxe = value
PenAxe = New Pen(colortitre, 2)
Me.Refresh()
End Set
End Property
Public Property CouleurTitre() As Color
Get
Return colortitre
End Get
Set(ByVal value As Color)
colortitre = value
BrushTitre = New Pen(colortitre).Brush
Me.Refresh()
End Set
End Property
Public Property NomTitre() As String
Get
Return titre
End Get
Set(ByVal value As String)
titre = value
End Set
End Property
Public Property OmbreCourbe() As Boolean
Get
Return ovisible
End Get
Set(ByVal value As Boolean)
ovisible = value
Me.Refresh()
End Set
End Property
Public Property CouleurFond() As Color
Get
Return Bcolor
End Get
Set(ByVal value As Color)
Bcolor = value
Me.Refresh()
End Set
End Property
Public Property CouleurFondGrille() As Color
Get
Return BcolorGrill
End Get
Set(ByVal value As Color)
BcolorGrill = value
Me.Refresh()
End Set
End Property
Public Property CouleurGrille() As Color
Get
Return colorGrill
End Get
Set(ByVal value As Color)
colorGrill = value
Me.Refresh()
End Set
End Property
Public Property NbCourbe() As Integer
Get
Return nbc
End Get
Set(ByVal value As Integer)
nbc = value
ReDim chartdata(nbe, value)
ReDim CourbeVisible(value)
ReDim PenCourbe(value)
End Set
End Property
Public Property NbElement() As Integer
Get
Return nbe
End Get
Set(ByVal value As Integer)
nbe = value + 1
ReDim chartdata(value, nbc)
End Set
End Property
Public Property PointVisible() As Boolean
Get
Return pvisible
End Get
Set(ByVal value As Boolean)
pvisible = value
Me.Refresh()
End Set
End Property
Private Function maxX() As Integer
Try
maxX = 1
If chartdata.GetLength(0) = 100 Then Exit Function
Dim i As Integer
For i = 1 To chartdata.GetLength(1) - 1
If Len(chartdata(i, 0)) > maxX Then maxX = Len(chartdata(i, 0))
Next
Catch ex As Exception
End Try
End Function
Private Function maxval() As Integer
Try
maxval = 0
If chartdata.GetLength(0) = 100 Then Exit Function
Dim i As Integer, j As Integer
For i = 1 To chartdata.GetLength(1) - 1
For j = 0 To chartdata.GetLength(0) - 1
If Val(chartdata(j, i)) > maxval And CourbeVisible(i) = True Then maxval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) > maxval And barVisible(i) = True Then maxval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) > maxval And CurseurVisible(i) = True Then maxval = Math.Ceiling(Val(chartdata(j, i)))
Next
Next
Catch ex As Exception
End Try
End Function
Private Function minval() As Integer
Try
minval = 0
If chartdata.GetLength(0) = 100 Then Exit Function
Dim i As Integer, j As Integer
For i = 1 To chartdata.GetLength(1) - 1
For j = 0 To chartdata.GetLength(0) - 1
If Val(chartdata(j, i)) < minval And CourbeVisible(i) = True Then minval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) < minval And barVisible(i) = True Then minval = Math.Ceiling(Val(chartdata(j, i)))
If Val(chartdata(j, i)) < minval And CurseurVisible(i) = True Then minval = Math.Ceiling(Val(chartdata(j, i)))
Next
Next
Catch ex As Exception
End Try
End Function
Private Sub Fond_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Fond.Paint
Image = New Bitmap(Fond.Width, Fond.Height)
Dim g As Graphics = Graphics.FromImage(Image)
Dim gf As Graphics = Fond.CreateGraphics
g.SmoothingMode = SmoothingMode.AntiAlias
Try
'calcul la marge droite et gauche
ml = (FontY.GetHeight * (1 + Len(CStr(maxval())))) * 1.6
'calcule de la marge basse
mb = (FontX.GetHeight + 10) * 2
'calcule marge basse si ecriture verticale
orientX = False
If (Fond.Width - (2 * ml)) / chartdata.GetLength(0) < (FontX.GetHeight * maxX() * 0.6) Then
mb = (maxX() * FontX.GetHeight * 0.5) + 10 + (FontX.GetHeight + 10)
orientX = True
End If
'dessine fond du graph
dessinefond(g)
dessgrille(g)
'dessine axe x
dessineaxe(g)
dessinebar(g)
dessinecurseur(g)
desscourbe(g)
dessinemoyenne(g)
gf.DrawImage(Image, 0, 0)
g.Dispose()
gf.Dispose()
Catch ex As Exception
End Try
End Sub
Private Sub dessineaxe(ByVal g As Graphics)
Try
PenAxe = New Pen(coloraxe, 2)
g.DrawLine(PenAxe, ml - 5, Fond.Height - mb, Fond.Width - ml + 5, Fond.Height - mb)
'dessine axe y
g.DrawLine(PenAxe, ml, mh, ml, Fond.Height - (mb - 5))
'g.DrawLine(PenAxe, Fond.Width - ml, mh, Fond.Width - ml, Fond.Height - (mb - 5))
'affiche nom axe x
g.DrawString(naxex, FontX, PenAxe.Brush, (Fond.Width - FontX.GetHeight * 0.5 * naxex.Length) / 2, Fond.Height - FontX.GetHeight - 10)
'affiche nom axe y
Dim sf As StringFormat = StringFormat.GenericTypographic
sf.FormatFlags = StringFormatFlags.DirectionVertical
g.DrawString(naxey, FontY, PenAxe.Brush, 10, (Fond.Height - mb - mh) / 2, sf)
' g.DrawString(naxey, FontY, PenAxe.Brush, Fond.Width - 10 - FontY.GetHeight, (Fond.Height - mb - mh) / 2, sf)
Catch ex As Exception
End Try
End Sub
Private Sub dessinefond(ByVal g As Graphics)
Try
rcontrole = New Rectangle(0, 0, Fond.Width, Fond.Height)
rgraph = New Rectangle(ml, mh, Fond.Width - (2 * ml), Fond.Height - mh - mb)
Dim lbrush As New LinearGradientBrush(rcontrole, Bcolor, Color.WhiteSmoke, LinearGradientMode.ForwardDiagonal)
g.FillRectangle(lbrush, rcontrole)
lbrush = New LinearGradientBrush(rgraph, BcolorGrill, Color.WhiteSmoke, LinearGradientMode.Horizontal)
g.FillRectangle(lbrush, rgraph)
Dim tp As New Pen(ccontour, 2)
If cvisible = True Then
g.DrawRectangle(tp, Math.Abs(Fond.Left), Fond.Top, Me.Width - 1, Me.Height - 1)
End If
Catch ex As Exception
End Try
End Sub
Private Sub dessgrille(ByVal g As Graphics)
Dim i As Integer, j As Integer, v As Integer, xx As Integer, yy As Integer, ec As Integer, it As Integer
Try
'affiche le titre
PenAxe = New Pen(coloraxe, 2)
ombre = Color.FromArgb(128, ombre.R, ombre.G, ombre.B)
Penombre = New Pen(ombre, PenCourbe(i).Width)
Penombre.StartCap = LineCap.Round
If ovisible = True Then g.DrawString(titre, FontTitre, Penombre.Brush, (Fond.Width / 2 - (titre.Length * FontTitre.GetHeight) / 4) + 3, 8)
g.DrawString(titre, FontTitre, BrushTitre, (Fond.Width / 2 - (titre.Length * FontTitre.GetHeight) / 4), 5)
'trouve la valeur max de l'axe y
v = maxval()
vmin = minval()
'calcule longeur des axe
xx = Fond.Width - (2 * ml)
yy = (Fond.Height - mb) - mh
'calcule echelle y
ec = ((yy) / (v - vmin))
If ec = 0 Then ec = 1
If ec < 20 Then
i = Math.Ceiling(20 / ec)
ec = ec * i
End If
it = Math.Ceiling((v - vmin) / (yy / ec))
ey = it
ny = ec
j = vmin
Dim lg As Integer
PenGrill = New Pen(colorgrill, 1)
PenGrill.DashStyle = DashStyle.Dash
For i = 0 To yy Step ec
lg = Len(CStr(j)) * (FontY.GetHeight * 0.5)
g.DrawLine(PenGrill, ml - 5, Fond.Height - mb - i, Fond.Width - ml + 5, Fond.Height - mb - i)
g.DrawString(CStr(j), FontY, PenAxe.Brush, ml - 10 - lg, Fond.Height - mb - i - (FontY.GetHeight / 2))
'g.DrawString(CStr(j), FontY, PenAxe.Brush, Fond.Width - ml + 5, Fond.Height - mb - i - (FontY.GetHeight / 2))
j = j + it
Next
'calcul echelle x
ec = Fix((xx * 100) / (chartdata.GetLength(0)))
j = 0
ex = ec
Dim mx As Integer = -1
Dim ii As Integer
For i = 0 To (xx * 100) - ec Step ec
ii = i / 100
g.DrawLine(PenGrill, ml + ii, Fond.Height - mb + 5, ml + ii, mh)
If orientX = True Then
Dim sf As StringFormat = StringFormat.GenericTypographic
sf.FormatFlags = StringFormatFlags.DirectionVertical
If ii > mx Then
g.DrawString(CStr(chartdata(j, 0)), FontX, PenAxe.Brush, ml + ii + (ec / 200) - (FontX.GetHeight * 0.5), Fond.Height - mb + 5, sf)
mx = ii + FontX.GetHeight
End If
Else
g.DrawString(CStr(chartdata(j, 0)), FontX, PenAxe.Brush, ml + ii + (ec / 200) - (FontX.GetHeight * 0.5 * (Len(chartdata(j, 0)) / 2)), Fond.Height - mb + 5)
End If
j = j + 1
Next
gg = g
Catch ex As Exception
End Try
End Sub
Private Sub desscourbe(ByVal g As Graphics)
Dim i As Integer, j As Integer, xx As Integer, yy As Integer, xx0 As Integer, yy0 As Integer, tx As Integer, tx0 As Integer
Try
For i = 1 To chartdata.GetLength(1) - 1
xx = ml * 100 + ex / 2
yy = (Fond.Height - mb) - ((chartdata(0, i) - vmin) / ey) * ny
PenCourbe(i).LineJoin = LineJoin.Round
For j = 1 To chartdata.GetLength(0) - 1
xx0 = (xx + ex)
yy0 = (Fond.Height - mb) - ((chartdata(j, i) - vmin) / ey) * ny
tx = xx / 100
tx0 = xx0 / 100
If CourbeVisible(i) = True And ovisible = True Then g.DrawLine(Penombre, tx + 7, yy + 7, tx0 + 7, yy0 + 7)
If CourbeVisible(i) = True Then g.DrawLine(PenCourbe(i), tx, yy, tx0, yy0)
xx = xx0
yy = yy0
Next
xx = ml * 100 + ex / 2
yy = (Fond.Height - mb) - ((chartdata(0, i) - vmin) / ey) * ny
If pvisible = True Then
For j = 1 To chartdata.GetLength(0) - 1
xx0 = (xx + ex)
yy0 = (Fond.Height - mb) - ((chartdata(j, i) - vmin) / ey) * ny
tx = xx / 100
tx0 = xx0 / 100
Dim bo As Brush = Brushes.LightGray
If CourbeVisible(i) = True And ovisible = True Then g.FillPie(Penombre.Brush, tx - (PenCourbe(i).Width * 2) + 7, yy - (PenCourbe(i).Width * 2) + 7, PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
If CourbeVisible(i) = True Then g.FillPie(PenCourbe(i).Brush, tx - (PenCourbe(i).Width * 2), yy - (PenCourbe(i).Width * 2), PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
xx = xx0
yy = yy0
Next
tx = xx / 100
If CourbeVisible(i) = True And ovisible = True Then g.FillPie(Penombre.Brush, tx - (PenCourbe(i).Width * 2) + 7, yy - (PenCourbe(i).Width * 2) + 7, PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
If CourbeVisible(i) = True Then g.FillPie(PenCourbe(i).Brush, tx - (PenCourbe(i).Width * 2), yy - (PenCourbe(i).Width * 2), PenCourbe(i).Width * 4, PenCourbe(i).Width * 4, 0, 360)
End If
Next
Catch ex As Exception
End Try
End Sub
Private Sub dessinebar(ByVal g As Graphics)
Dim i As Integer, j As Integer, v As Integer, xx As Integer, yy As Integer, tx As Integer, lb As Integer
Try
'calcule largeur bar
j = 0
For i = 1 To chartdata.GetLength(1) - 1
If barVisible(i) = True Then j = j + 1
Next
lb = ex / j
lb = lb / 100
'dessine bar
v = 0
For i = 1 To chartdata.GetLength(1) - 1
xx = ml * 100 + (lb * 100) * v
If barVisible(i) = True Then v = v + 1
ombre = Color.FromArgb(128, ombre.R, ombre.G, ombre.B)
Penombre = New Pen(ombre, PenCourbe(i).Width)
Penombre.StartCap = LineCap.Round
Dim rbar As Rectangle
For j = 0 To chartdata.GetLength(0) - 1
yy = (Fond.Height - mb) - (((chartdata(j, i) - vmin) / ey) * ny + 1)
tx = (xx / 100)
rbar = New Rectangle(tx, yy, lb / 2, Fond.Height - (yy + mb))
Dim tmpcolor As Color
tmpcolor = Color.FromArgb(64, PenCourbe(i).Color.R, PenCourbe(i).Color.G, PenCourbe(i).Color.B)
Dim tmpbrush = New LinearGradientBrush(rbar, PenCourbe(i).Color, tmpcolor, LinearGradientMode.Horizontal)
tmpbrush.WrapMode = 3
If barVisible(i) = True Then g.FillRectangle(tmpbrush, tx, yy, lb, Fond.Height - (yy + mb))
xx = xx + ex
Next
Next
Catch ex As Exception
End Try
End Sub
Private Sub dessinecurseur(ByVal g As Graphics)
Dim i As Integer, j As Integer, xx As Integer, yy As Integer, xx0 As Integer, yy1 As Integer, tx As Integer, tx1 As Integer, xx1 As Integer
Try
'dessine curseur
For i = 1 To chartdata.GetLength(1) - 1
xx = ml * 100
Dim rbar As Rectangle
For j = 0 To chartdata.GetLength(0) - 1
yy = (Fond.Height - mb) - (((chartdata(j, i) - vmin) / ey) * ny + 1)
tx = (xx / 100)
xx0 = ex / 100
rbar = New Rectangle(tx, yy, xx0 / 2, 2)
Dim tmpcolor As Color
tmpcolor = Color.FromArgb(0, PenCourbe(i).Color.R, PenCourbe(i).Color.G, PenCourbe(i).Color.B)
Dim tmpbrush = New LinearGradientBrush(rbar, tmpcolor, PenCourbe(i).Color, LinearGradientMode.Horizontal)
tmpbrush.WrapMode = 3
If curseurVisible(i) = True Then g.FillRectangle(tmpbrush, tx, yy, xx0, 2)
rbar = New Rectangle(tx, yy, xx0 / 4, 2)
tmpbrush = New LinearGradientBrush(rbar, PenCourbe(i).Color, tmpcolor, LinearGradientMode.Horizontal)
tmpbrush.WrapMode = 3
xx1 = xx0 / 2
tx1 = tx + (xx0 / 4)
yy1 = yy - 1
tx = tx + (xx0 / 2)
If curseurVisible(i) = True Then g.FillRectangle(tmpbrush, tx1, yy1, xx1, 4)
If curseurVisible(i) = True And pvisible = True Then g.FillPie(PenCourbe(i).Brush, tx - 6, yy1 - 5, 12, 12, 0, 360)
xx = xx + ex
Next
Next
Catch ex As Exception
End Try
End Sub
Private Sub dessinemoyenne(ByVal g As Graphics)
Dim i As Integer, j As Integer, yy As Integer, v As Integer, m As Double
Try
'dessine moyenne
For i = 1 To chartdata.GetLength(1) - 1
v = 0
For j = 0 To chartdata.GetLength(0) - 1
v = v + (chartdata(j, i) - vmin)
Next
m = (v / chartdata.GetLength(0)) * 100
moy(i) = m / 100
yy = Fond.Height - ((m / ey) * ny / 100) - mb
Dim tp As New Pen(Color.AliceBlue, 2)
tp.Color = PenCourbe(i).Color
tp.DashStyle = DashStyle.Dash
If ValeurMoyenne(i) = True Then g.DrawLine(tp, ml, yy, Fond.Width - (ml), yy)
tp.Dispose()
Next
Catch ex As Exception
End Try
End Sub
Private Sub graph_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim i As Integer
Try
Fond.Top = 0
Fond.Left = 0
Fond.Height = Me.Height
Fond.Width = Me.Width
For i = 0 To 2
PenCourbe(i) = New Pen(Color.Red, 3)
Next
Me.SetStyle(Windows.Forms.ControlStyles.ResizeRedraw, True)
Catch ex As Exception
End Try
End Sub
Private Sub Panel1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Fond.MouseDown
Try
If zoom = False Then Exit Sub
If e.Button = Windows.Forms.MouseButtons.Left Then
If Fond.Width > 4000 Then Exit Sub
Fond.Dock = Windows.Forms.DockStyle.None
Fond.Left = -(Math.Abs(Fond.Left) + e.X)
Fond.Width = Fond.Width * 2
If Fond.Width <= Me.Width Then Fond.Left = 0
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
If Fond.Width = Me.Width Then Exit Sub
Fond.Dock = Windows.Forms.DockStyle.None
Fond.Left = -(Math.Abs(Fond.Left) - e.X / 2)
Fond.Width = Fond.Width / 2
If Fond.Width <= Me.Width Then
Fond.Left = 0
Fond.Width = Me.Width
End If
End If
Catch ex As Exception
End Try
End Sub
Private Sub graph_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Try
Fond.Top = 0
Fond.Left = 0
Fond.Height = Me.Height
Fond.Width = Me.Width
Me.Refresh()
Catch ex As Exception
End Try
End Sub
End Class
Posté le :
13/09/2007 14:58:01
Déposé sur
User control graphique vb 2005
Ton code ressemble étrangement à celui de nicolas99 posté en 2006, mis à part que t'as mis de l'ordre et remplacé le nom des variables par des noms plus cohérents...
J'ai trouvé comment afficher des données négatives:
Il faut utiliser la fonction MinVal() mais il faut la corriger car il y a une erreur:
"If OrdreCourbes.Count = 0 Then Return MaxVal()" c'est Return MinVal et pas MaxVal..
Tu crée une variable privée dans le module (perso j'ai crée vmin)
dans la fonction DessineGrille, tu apelles Minval (par exemple après avoir appelé Maxval) et tu sauve la valeur min dans la variable vmin.
Tu rajoutes ensuite ce vmin dans chaque calcul de graphe, il doit y avoir 5 ou 6 zones à modifier (dans dessinecourbe, dessinemoyenne, dessinebar...)
La zone de code exacte à modifier est celle où tu définis les valeur de Y en fonction de TempValeurs
Par exemple "yCourbe = Fond.Height - MargeBasse - (TempValeurs(0) / EchelleAxeY * PasDeDessinY)"
à chaque fois tu rajoutes -vmin, ce qui donne dans l'exemple précédent:
"yCourbe = Fond.Height - MargeBasse - ((TempValeurs(0)-vmin) / EchelleAxeY * PasDeDessinY)"
C'est pareil à chaque fois que tu as y = quelque chose fonction de TempValeur.
Je ne donne pas le module modifié puisque j'ai en fait utilisé le code initial de nicolas99 et le variables ne correspondent pas...
Posté le :
13/09/2007 14:53:26
Déposé sur
User control graphique vb 2005
Est-il possible d'afficher des valeurs négatives??
Posté le :
12/09/2007 16:43:43
Déposé sur
User control graphique vb 2005
Bonjour,
Chez moi ça ne marche pas, j'ai un message d'erreur au chargement du projet: "Could not find type 'Graphique.UcGraph'".
une solution peut-être??
Merci
Posté le :
10/09/2007 17:14:00
Déposé sur
Ecriture & lecture en mode binaire dans un fichier
Je confirme que ce n'est pas du fichier bianire ça, c'est facile à voir en ouvrant le fichier créé avec un éditeur de texte, ça n'a rien de binaire!
Lorsque tu fais un "Put #N° file, 1 octet, Caractère" c'est le code ascii de 'Caractère' qui est enregistré dans le fichier, et pas le caractère lui même. Pour faire réellement de l'enregistrement en binaire, il faut ajouter une ligne:
CaracterBin = chr(Caractere)
Comme ça VB va considérer que ton caratère est un code ascii et va réellement enregistrer ce que tu lui demande.
Et arrêtez de vous insulter, un code aussi simple n'en vaut pas la peine.
Posté le :
24/08/2006 17:27:11
Déposé sur
Plein d'opérations simple pour gérer les process
Es-tu sûr que ton code fonctionne sous Windows NT ?
Parce que j'ai essayer d'affecter à "handle" le n° d'ouverture du fichier directement et ça ne parche pas quand même.
L'application à fermer est un exécutable Vb, la racine est sous C:, j'ai donc essayé comme titres "test.exe", "C:test.exe", "test" ......
Là je comprend pas...
Posté le :
28/08/2003 10:16:02
Déposé sur
Plein d'opérations simple pour gérer les process
Bonjour,
Je veux pouvoir arrêter un exécutable à partir d'un programme VB,
je pense que la fonction "Fermer_app" que tu propose est la solution à mon problème. Mais je n'arrive pas à la faire fonctionner car la variable "handle" utilisée dans la fonction vaut toujours "0".
La chaîne de chacartères "Titre" est bien le nom de l'exécutable à fermer avec son arborescence complète ?
Par avance, merci de ton aide.
Posté le :
27/08/2003 17:41:36
1
Nos sponsors
Derniers Blogs
NOUVEAU SYSTèME D'AIDE POUR VISUAL STUDIO 2010 : POUR CEUX QUI N'APPRéCIENT PAS TROP L'ABSENCE D'INDEX...
NOUVEAU SYSTèME D'AIDE POUR VISUAL STUDIO 2010 : POUR CEUX QUI N'APPRéCIENT PAS TROP L'ABSENCE D'INDEX...
par coq
...un projet tente de palier à ce manque : H3Viewer Il n'est certes pas encore parfait, mais il a le mérite d'exister. Dans mon cas il a 2 défaut (en utilisation sur la version RC, donc à revalider avec des versions ultérieures) : Je suis in...
Cliquez pour lire la suite de l'article
par coq
L'INTERFACE NATURELLE DE WINDOWS PHONE 7 SERIES
L'INTERFACE NATURELLE DE WINDOWS PHONE 7 SERIES
par odewit
La tendance est aux interfaces naturelles (NUI), et le keynote de Bill Buxton au MIX l'a bien souligné. La charte graphique et ergonomique de Windows Phone 7 a donc été entièrement repensée en vue d'obtenir un maximum d'efficacité sur ce point. En re...
Cliquez pour lire la suite de l'article
par odewit
COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE?
COMMENT MAPPER UNE VUE SQL SUR UNE COLLECTION DE COMPLEX TYPE?
par Matthieu MEZIL
Avec EF, les vues doivent être mappées sur des entity types. Le problème c'est que les entity types doivent avoir une clé. Avec EF, nous avons les complex type qui n'ont pas de clé mais les vues ne peuvent pas être mappées dessus. Avec EF4, il est possibl...
Cliquez pour lire la suite de l'article
par Matthieu MEZIL
SQL SERVER : QUERY NOTIFICATION OU COMMENT êTRE NOTIFIé DE MODIFICATIONS DE DONNéES CôTé APPLICATION (SQLDEPENDENCY)
SQL SERVER : QUERY NOTIFICATION OU COMMENT êTRE NOTIFIé DE MODIFICATIONS DE DONNéES CôTé APPLICATION (SQLDEPENDENCY)
par christian
Cette fonctionnalité à vue le jour dans Ado.Net 2.0 et s'appuie sur SQL Server 2005 (et plus) même si elle fonctionne avec SQL Server 2000. Le principe de fonctionnement côté applicatif est assez simple, on fournit une requête et lorsque le résultat d...
Cliquez pour lire la suite de l'article
par christian
[WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL?
[WF4] UN BINDING ACTIVITY/ACTIVITYDESIGNER QUI PASSE MAL?
par JeremyJeanson
Certain d'entre vous on peut être vécu cette situation embarrassante après quelques temps passer avec WF4 : Au début avec mon " ActivityDesigner" , tout allait bien. Et puis un jour j'ai au des problèmes de " Binding" . Alors nous sommes allé sur le site ...
Cliquez pour lire la suite de l'article
par JeremyJeanson
La suite
RSS
Côté IT
A la découverte de la console d?administration de Team Foundation Server 2010
A la découverte de la console de configuration de Team Foundation Server 2010
A la découverte du programme d?installation de Team Foundation Server 2010
Empècher Windows de créer les fichiers THUMBS.DB
Nettoyage de disque sans compression
Comment faire un CD bootable depuis Nero 7
Modifier la liste des valeurs proposées par le champ Assigned To dans les Elements de travail de ...
La suite
RSS
Offres d'emploi
Recherche Développeur SharePoint
Recherche Développeur web
Recherche DEVELOPPEUR WEB PHP/MYSQL/JAVASCRIPT EN ALTERNANCE/STAGE (H/F)
Recherche DEVELOPPEUR WEB PHP/MYSQL/JAVASCRIPT SENIOR (H/F)
Recherche Développeur web PHP polyvalent
Recherche Ingénieur d'études .NET
Recherche Webmaster
Déposer une offre
La suite
RSS
Formations Video
Cinema 4D par la pratique
Techniques avec Photoshop : correction des couleurs
Créer son blog avec WordPress
Montage photo : Vacances au ski
Retouche beauté : Mister Bad Boy
After Effects CS4 pour les utilisateurs de Photoshop
Final Cut Pro 7 : les fondamentaux
La suite
RSS
Appels d'offres
Realisation de bannieres et encarts pub
Budget :
500€
outil audit microsoft excel
Budget :
1 000€
Recherche traducteur francais portugais
Budget : ND
La suite
RSS
Logiciels
Academy System (10.9.4.0)
ACADEMY SYSTEM (10.9.4.0)
Logiciel de gestion des établissements. - élèves/étudiants (inscription, dossier, absence...) -...
Cliquez pour télécharger Academy System
Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)
XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)
Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise...
Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate
Xilisoft DVD Ripper Ultimate (5.0.64.0304)
XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)
Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ...
Cliquez pour télécharger Xilisoft DVD Ripper Ultimate
Axalot, logiciel de sauvegarde de données en ligne (1.10.108.1)
AXALOT, LOGICIEL DE SAUVEGARDE DE DONNéES EN LIGNE (1.10.108.1)
Perdre tout le contenu de votre disque dur, vous imaginez ? Vos photos, vos musiques, votre compt...
Cliquez pour télécharger Axalot, logiciel de sauvegarde de données en ligne
Rigs of Rods (63.3)
RIGS OF RODS (63.3)
c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo...
Cliquez pour télécharger Rigs of Rods
+ de logiciels à télécharger
Vidéos drôles
Banana Song
Foot féminin
Maman, j'aime pas mamie
Comment attraper la grippe A
Parodie Pub Window 7
Daft Bodies - Harder Better Faster Stronger
Royal Fuhrer
La suite
RSS
Sondage...
Votre navigateur n'utilise pas le javascript, pour
voter aux sondages de ce site, cliquez ici
Statistiques
1 624 300
membres
95
nouveaux aujourd'hui
15 512
membres club
Comparez les prix
Runaway 2 : The Dream Of The Turtle pour Windows
Entre 15€ et 15€
Visiter le guide achat
CalendriCode
Mars
2010
L
M
M
J
V
S
D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Consulter la suite du CalendriCode
Photothèque
Visiter la photothèque
CS Tool Box