Jump to content
raynor009

[GHID][VB.NET]Cum sa facem un ProgressBar vertical

Recommended Posts

Salut, astazi am sa va arat cum sa facem ca progresbarul nostru sa fie vertical. Metoda este foarte simpla si se aplica folosind un simplu class. Sa incepem.

Creati un nou WindowsFormsApplications si dupaia adaugati un class /Project/Add Class . In class stergeti tot si dati Copy & Paste (ca asa ii misto) la codul meu:

   Imports System
Imports System.Windows.Forms

Public Class [COLOR="#FF0000"]raynor009VerticalProgressBar[/COLOR] // Acesta va fi numele noului coponent
Inherits ProgressBar
Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.Style = cp.Style Or &H4
Return cp
End Get
End Property
End Class

Dupa ce ati facut asta dam un Debug si dupa ce oprim programul in ToolBox o sa va apara o categorie noua cu componentul raynor009VerticalProgressBar sau ce nume i-ati dat voi. Ca sa vedem daca merge adaugam noul progresbar un form si mai adaugam un buton. La buton adaugam urmatorul cod:

If Raynor009VerticalProgressBar1.Value = Raynor009VerticalProgressBar1.Value + 10

Dam debug si cand apasam butonul in loc ca bara aia verde sa mearga in dreapa va incepe sa urce tot mai sus.

Sper ca va fost de folos si ati invat ceva nou. Bafta la programare si ne vedem in tutorialul urmator.

Edited by raynor009
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...