لانشاء شريط تقدمي 'This code will make a percentage progress bar, like those in installation programs. 'Add 1 PictureBox and 1 CommandButton to your form. 'Set The PictureBox DrawMode property to 6 - Invert. 'Insert the following code to your form:
Private Sub PerCnt(iNewValue As Integer) If iNewValue > 100 Or iNewValue < 0 Then Beep Exit Sub End If Picture1.Cls Picture1.FontSize = 12 Picture1.ScaleMode = 0 Picture1.ScaleWidth = 100 Picture1.ScaleHeight = 10 Picture1.CurrentY = 2 Picture1.CurrentX = Picture1.ScaleWidth / 2 - (Picture1.ScaleWidth / 15) Picture1.Print Str(iNewValue)
تنشيط/الغاءتنشيط شريط الادوات Dim i As Integer 'you will need a reference from projects, components 'here, find the standard toolbar. Once you have the 'toolbar on your form and have placed buttons on it, 'this code will work, otherwise it is no good.
'"8" here is the number of buttons on my toolbar, 'change this number to the number of buttons you 'have, this number has to be exact. Private Sub Command1_Click() 'to enable all buttons on a toolbar use this code: For i = 1 To 8 Toolbar1.Buttons(i).Enabled = True Next End Sub
Private Sub Command2_Click() 'to disenable all buttons on a toolbar use this code: For i = 1 To 8 Toolbar1.Buttons(i).Enabled = False Next End Sub
تنشيط شريط التمرير الافقي 'Add 1 Rich Text Box to your Form. Set the Rich Text Box Scrollbars property to '1 (for only horizonal scroll bar) or to 3 (for both horizonal and vertical). 'Insert the following code to your form:
Private Sub Form_Load() 'The size of the 'RichTextBox1.RightMargin' determine the size of the horizonal 'scroll bar. Increase/Decrease the '10000' below to Reduce/Enlarge the Horizonal 'scroll bar size. if the 'RichTextBox1.RightMargin' will be equal to 'RichTextBox1.Width' 'there will be no horizonal scroll bar. RichTextBox1.RightMargin = RichTextBox1.Width 10000 End Sub
شريط تقدم بأستخدامShape: 'How to create a progress bar with a shape 'By Colin Kemege socksnandspoons@hotmail.com 'Add a Form, name your form: frmProgress 'Make a shape: Shape1 'Make a Timer: Timer1 Dim p As Integer
Private Sub Form_Load() Me.Width = 7000 Timer1.Interval = 50 'you can change this to manipulate how fast/slow the shape goes Shape1.BorderColor = vbWhite 'change this to whatever color you want Shape1.Width = 0 'customize this if you change the timer code Shape1.FillStyle = 0 'so vblack shows up Shape1.FillColor = vbBlack 'change this to whatever color you want End Sub
Private Sub Timer1_Timer() 'this timer is the key to when our shape moves and how much Randomize p = Int((5 - 2 1) * Rnd 2) 'it moves randomly now(to an extent), but you can customize it If p = 2 Or p = 3 Then Shape1.Width = Shape1.Width 65 'customize by changing the "shape.width x", the Rnd numbers, and by changing how far the shape goes until an event occurs End If If p = 4 Or p = 5 Then Shape1.Width = Shape1.Width 22 End If If Shape1.Width >= 4335 Then 'right now it ends the program and displays a msgbox MsgBox "Data has been loaded" 'change this event to your likings Unload Me End End If End Sub