IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

rendre Chart invisible


Sujet :

VB.NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2012
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2012
    Messages : 11
    Par défaut rendre Chart invisible
    Urgent! Je n'arrive pas à rendre la courbe invisible après un certain temps (Timer), je ne peux pas accèder au control "Chart1" déclaré dans "BackgroundWorker3_RunWorkerCompleted" à partir de "Timer5_Tick"
    Un peux d'aide sera la bienvenue

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
            Timer3.Stop()
            BackgroundWorker3 = New BackgroundWorker
            BackgroundWorker3.WorkerReportsProgress = True
            BackgroundWorker3.RunWorkerAsync()
            While BackgroundWorker3.IsBusy()
                Windows.Forms.Application.DoEvents()
            End While
            Timer5.Interval = 15000
            Timer5.Start()
        End Sub
    
    Private Sub BackgroundWorker3_DoWork(ByVal sender As System.Object, ByVal e As DoWorkEventArgs) Handles BackgroundWorker3.DoWork
            Dim worker As BackgroundWorker = DirectCast(sender, BackgroundWorker)
            Try
                connection.Close()
                Dim sql4 As String = "SELECT ThreatType, Count FROM EPOEvents_ThreatTypesView  ORDER BY Count DESC"
                Dim dataadapter4 As New SqlDataAdapter(sql4, connection)
                connection.Open()
                dataadapter4.Fill(dt4)
            Catch ex As Exception
    
            End Try
        End Sub
    
        Private Sub BackgroundWorker3_RunWorkerCompleted(ByVal sender As Object, _
                                                ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker3.RunWorkerCompleted
            Dim ChartArea1 As ChartArea = New ChartArea()
            Dim Legend1 As Legend = New Legend()
            Dim Series1 As Series = New Series()
            Dim Chart1 = New DataVisualization.Charting.Chart()
            Me.Controls.Add(Chart1)
            Chart1.DataSource = dt4
    
            ChartArea1.Name = "ChartArea1"
            Chart1.ChartAreas.Add(ChartArea1)
            Chart1.Size = New System.Drawing.Size(980, 600)
            Chart1.BorderSkin.SkinStyle = BorderSkinStyle.Sunken
            Chart1.BorderSkin.BorderDashStyle = ChartDashStyle.Solid
            Chart1.BorderSkin.BackColor = Color.Red
            Chart1.BorderSkin.BackSecondaryColor = Color.Blue
            Chart1.BorderSkin.BackHatchStyle = ChartHatchStyle.DarkVertical
            Legend1.Name = "Legend1"
            Chart1.Legends.Add(Legend1)
            Chart1.Location = New System.Drawing.Point(20, 150)
            Chart1.Name = "Chart1"
            Series1.ChartArea = "ChartArea1"
            Series1.Legend = "Legend1"
            Series1.Name = "ThreatStat"
            Chart1.Series.Add(Series1)
            Chart1.TabIndex = 0
            Chart1.Text = "Chart1"
            Chart1.Series("ThreatStat").XValueMember = "ThreatType"
            Chart1.Series("ThreatStat").YValueMembers = "Count"
            Chart1.Series("ThreatStat").Font = New Font("Arial", 13, FontStyle.Bold)
            Chart1.Series("ThreatStat").IsValueShownAsLabel = True
            Chart1.Series("ThreatStat").LabelForeColor = Color.Firebrick
            Chart1.Series(0).Color = Color.FromArgb(128, Color.Blue)
            Chart1.Series(0).IsVisibleInLegend = False
            Chart1.AlignDataPointsByAxisLabel()
            Series1.ChartType = SeriesChartType.Column
            Chart1.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
            Chart1.ChartAreas("ChartArea1").Area3DStyle.Rotation = 40
            Chart1.ChartAreas("ChartArea1").Area3DStyle.Inclination = 90
            Chart1.ChartAreas("ChartArea1").Area3DStyle.PointDepth = 100
            Chart1.ChartAreas("ChartArea1").Area3DStyle.PointGapDepth = 0
            Chart1.ChartAreas(0).Area3DStyle.WallWidth = 10
            Chart1.ChartAreas(0).Area3DStyle.LightStyle = LightStyle.Realistic
            ChartArea1.AxisX.LabelStyle.Angle = -55
            ChartArea1.AxisX.LabelStyle.Font = New Font("Verdana", 10, FontStyle.Bold)
            ChartArea1.AxisY.LabelStyle.Font = New Font("Verdana", 10, FontStyle.Bold)
            ChartArea1.AxisX.Interval = 1
            Chart1.Height = Chart1.Height - 15
        End Sub
    
        Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
            Timer5.Stop()
    
            Chart1.visible = False
    
            Me.BackgroundImage = System.Drawing.Image.FromFile("C:\Documents and Settings\atel_deco\Mes documents\Visual Studio 2005\Projects\background worker\background worker\sagemcom_logo.jpg")
            Me.BackgroundImageLayout = ImageLayout.Center
            .
            .
            .
            .
        End Sub

  2. #2
    Membre confirmé
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Mars 2008
    Messages
    109
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Mars 2008
    Messages : 109
    Par défaut
    Salut,
    T'as pas essayé de mettre le BackgroundWorker3 en Public ou de déclarer le chart comme public

  3. #3
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Juillet 2012
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2012
    Messages : 11
    Par défaut
    Citation Envoyé par fishingman Voir le message
    Salut,
    T'as pas essayé de mettre le BackgroundWorker3 en Public ou de déclarer le chart comme public
    oui j'ai essayer de déclarer le chart comme public est ça a bien fonctionner merci

Discussions similaires

  1. Rendre formulaire invisible
    Par nadia68 dans le forum IHM
    Réponses: 4
    Dernier message: 03/02/2007, 10h42
  2. Rendre visible / invisible plusieurs éléments en même temps
    Par Bluespike62 dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 23/01/2006, 17h43
  3. [FLASH 8] Rendre visible/invisible un bouton sur un clic
    Par PrinceMaster77 dans le forum Flash
    Réponses: 11
    Dernier message: 10/01/2006, 15h08
  4. [VB.NET]Rendre IE invisible
    Par biau dans le forum Windows Forms
    Réponses: 10
    Dernier message: 16/11/2005, 15h52
  5. Réponses: 2
    Dernier message: 06/05/2005, 21h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo