Prikazi cijelu temu 04.12.2019 17:46
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: dodavanje labela, tekst boksova i dugmadi
PreuzmiIzvorni kôd (Visual Basic):
  1. Sub Add_Dynamic_CommandButton()
  2.    
  3.     'Add Dynamic CommandButton and assign it to object 'CmdBtn'
  4.    Set CmdBtn = UserForm2.Controls.Add("Forms.CommandButton.1")
  5.     With CmdBtn
  6.         .Caption = "CommandButton"
  7.         .Left = 12
  8.         .Top = 10
  9.         .Width = 102
  10.     End With
  11.  
  12.     UserForm2.Show
  13. End Sub
  14.  
  15. Sub add_Label()
  16.     'dodaj label
  17.      Set Labela = UserForm2.Controls.Add("Forms.label.1")
  18.           With Labela
  19.         .Caption = "Ovo je labela"
  20.         .Left = 12
  21.         .Top = 50
  22.         .Width = 102
  23.     End With
  24.     UserForm2.Show
  25. End Sub
  26.  
  27. Sub add_Text()
  28.     'dodaj txtbox
  29.    Set ctlTxt = UserForm2.Controls.Add("Forms.TextBox.1")
  30.     With ctlTxt
  31.         .Value = "Neki tekst"
  32.         .Top = 12
  33.         .Left = 12
  34.         .Width = 150
  35.     End With
  36.     UserForm2.Show
  37. End Sub


sad bi bilo zanimljivo tvoje loto napraviti sa add comand buton.
To je u klasicnom vb lako jer ima index pa mozes sa jednim imenom napraviti mnogo kontrola.
u form2 koliko ja znam toga nema.
Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.