Vb za pocetnike, poznavaoce,profesionalce -primeri i trikovi

7

Vb za pocetnike, poznavaoce,profesionalce -primeri i trikovi

offline
  • Pridružio: 27 Apr 2007
  • Poruke: 28
  • Gde živiš: kraljevina MIRIJEVO!

Kako da recimo kad se otvori aplikacija pokaze jednu formu na nekoliko sekundi a zatim otvori drugu!!!



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • Pridružio: 28 Jun 2004
  • Poruke: 990
  • Gde živiš: Kucura

Private Sub Form_Load() Timer1.Interval = 1000 'vreme koliko da prva forma bude otvorena u ms Timer1.Enabled = True End Sub Private Sub Timer1_Timer() Unload Me Form2.Show End Sub



offline
  • Pridružio: 27 Apr 2007
  • Poruke: 28
  • Gde živiš: kraljevina MIRIJEVO!

E kako da se na enter izvrsi neka radnja???

pokusao sam ovako npr:

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEnter Then
Unload Me
End If
End Sub

offline
  • Alics  Male
  • Ugledni građanin
  • Pridružio: 02 Apr 2006
  • Poruke: 353
  • Gde živiš: Šabac

Malčice kasnim sa odgovorom, no nema veze Smile

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then     KeyAscii = 0     Unload Me End If End Sub

Što se tiče linije KeyAscii = 0, ona služi da program ne pišti kada pritisneš enter. Međutim, kada se kao akcija posle pritiska na enter postavi Unload Me, ova linija nije potrebna.

offline
  • malj 
  • Novi MyCity građanin
  • Pridružio: 08 Avg 2007
  • Poruke: 3

pozzzzzzzzzz ja sam novi ovde pa htio bih vas pitat moze li mi tko od vas dati osnovne komande za vb6.0 tek sam poceo da ucim pa ako moze

offline
  • Pridružio: 28 Jun 2004
  • Poruke: 990
  • Gde živiš: Kucura

heh.. kako mislis osnovne komande? Uzmi knjigu, citaj.. tamo ces naci te komande. Ovako ako ti ja napisem recimo...
Petlja :: If neki_uslov then uradi_nesto
Tebi to nista ne znaci posto nemas pojma cemu to sluzi.. nadji neke tutoriale na netu ako neces da kupujes knjigu. Tako sam i ja ucio u pocetku Wink

Dopuna: 09 Avg 2007 21:20

Cika Google Wink

Prvi od rezultata

offline
  • malj 
  • Novi MyCity građanin
  • Pridružio: 08 Avg 2007
  • Poruke: 3

hvala evo pomalo se vec snalazim hehe krenulo i mene po prvi put u zivotu

offline
  • Pridružio: 11 Avg 2007
  • Poruke: 27

Evo da i ja doprinesem nesto ovom delu foruma,jer ova tema je stvarno dobra.Evo koda za "eksplodirajucu" formu:


Ovo ide u modul:

#If Win16 Then     Type RECT         Left As Integer         Top As Integer         Right As Integer         Bottom As Integer     End Type #Else     Type RECT         Left As Long         Top As Long         Right As Long         Bottom As Long     End Type #End If #If Win16 Then     Declare Sub GetWindowRect Lib "user.dll" (ByVal hwnd As Integer, lpRect As RECT)     Declare Function GetDC Lib "user.dll" (ByVal hwnd As Integer) As Integer     Declare Function ReleaseDC Lib "user.dll" (ByVal hwnd As Integer, ByVal hdc As _         Integer) As Integer     Declare Sub SetBkColor Lib "gdi.dll" (ByVal hdc As Integer, ByVal crColor As Long)     Declare Sub Rectangle Lib "gdi.dll" (ByVal hdc As Integer, ByVal X1 As Integer, _         ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)     Declare Function CreateSolidBrush Lib "gdi.dll" (ByVal crColor As Long) As Integer     Declare Sub DeleteObject Lib "gdi.dll" (ByVal hObject As Integer) #Else     Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, _         lpRect As RECT) As Long     Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long     Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As Long, ByVal _         hdc As Long) As Long     Declare Function SetBkColor Lib "gdi32.dll" (ByVal hdc As Long, ByVal _         crColor As Long) As Long     Declare Function Rectangle Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, _         ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long     Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long     Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long #End If Sub ExplodeForm(f As Form, Movement As Integer)     Dim myRect As RECT     Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%     Dim TheScreen As Long     Dim Brush As Long         GetWindowRect f.hwnd, myRect     formWidth = (myRect.Right - myRect.Left)     formHeight = myRect.Bottom - myRect.Top     TheScreen = GetDC(0)     Brush = CreateSolidBrush(f.BackColor)     For i = 1 To Movement         Cx = formWidth * (i / Movement)         Cy = formHeight * (i / Movement)         X = myRect.Left + (formWidth - Cx) / 2         Y = myRect.Top + (formHeight - Cy) / 2         Rectangle TheScreen, X, Y, X + Cx, Y + Cy         DoEvents     Next i     X = ReleaseDC(0, TheScreen)     DeleteObject (Brush) End Sub Public Sub ImplodeForm(f As Form, Movement As Integer)     Dim myRect As RECT     Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%     Dim TheScreen As Long     Dim Brush As Long         GetWindowRect f.hwnd, myRect     formWidth = (myRect.Right - myRect.Left)     formHeight = myRect.Bottom - myRect.Top     TheScreen = GetDC(0)     Brush = CreateSolidBrush(f.BackColor)     For i = Movement To 1 Step -1         Cx = formWidth * (i / Movement)         Cy = formHeight * (i / Movement)         X = myRect.Left + (formWidth - Cx) / 2         Y = myRect.Top + (formHeight - Cy) / 2         Rectangle TheScreen, X, Y, X + Cx, Y + Cy         DoEvents     Next i     X = ReleaseDC(0, TheScreen)     DeleteObject (Brush) End Sub

A ovo u formu:


Private Sub Command1_Click()     Call ImplodeForm(Me, 500)     End     Set Form1 = Nothing End Sub Private Sub Form_Load()     Call ExplodeForm(Me, 500) End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)     Call ImplodeForm(Me, 500) End Sub


U formu stavite jedno komandno dugme,a ovde umesto broja 500 mozete staviti broj koji hocete.(Sto veci broj-sporija "eksplozija")

offline
  • Pridružio: 06 Maj 2007
  • Poruke: 241
  • Gde živiš: Beograd

Klase i objekti-Clanak o klasama i objektima

Na http://www.fesb.hr/~tihana/ imate clanak OBJEKTNO.doc, clanak o klasama i objektima.

Na http://edais.mvps.org/Tutorials/AdvClass/index.html imate Advanced classes in VB u pdf formatu.



Kolekcija ActiveX control(OCX)

Evo nekoliko ocx kontrola.

https://www.mycity.rs/must-login.png

https://www.mycity.rs/must-login.png

https://www.mycity.rs/must-login.png

https://www.mycity.rs/must-login.png

https://www.mycity.rs/must-login.png


Rotacija kvadra u 3D

Rotacija kvadra u 3D.


https://www.mycity.rs/must-login.png


mod: biser-x: Spojeno vise tema u jednu poruku

offline
  • Pridružio: 25 Maj 2007
  • Poruke: 114
  • Gde živiš: Novi Sad, Sombor

Evo i od mene jedan program sa rotacijom u 3D
mycity.rs/must-login.png

Ko je trenutno na forumu
 

Ukupno su 928 korisnika na forumu :: 21 registrovanih, 3 sakrivenih i 904 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: A.R.Chafee.Jr., Belisarius, bestguarder, djboj, Istman, jukeboxer, krkalon, ladro, laurusri, Panter, Poker, saputnik plavetnila, sasa87, Silvertooth, Tila Painen, tmanda323, trutcina, Tvrtko I, Vatreni Zmaj, Vlada78, voja64