About: VB vs Delphi - Creating Components at Runtime   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

In VB 6 create a new project with a label (Label1) and a textbox side-by-side (Text1). Set the Index property to 0. This will set up a control array. Add the following code to the form: Option Explicit Private Function mfPixelsToTwips(ByVal vlngPixels As Long) As Long mfPixelsToTwips = vlngPixels * 15 End Function Private Sub Form_Load() Dim llngIndex As Long For llngIndex = 1 To 5 Load Label1(llngIndex) Label1(llngIndex).Top = Label1(llngIndex - 1).Top + Label1(llngIndex - 1).Height + mfPixelsToTwips(3) Label1(llngIndex).Visible = True Load Text1(llngIndex) Text1(llngIndex).Top = Label1(llngIndex - 1).Top + Label1(llngIndex - 1).Height + mfPixelsToTwips(3) Tex

AttributesValues
rdfs:label
  • VB vs Delphi - Creating Components at Runtime
rdfs:comment
  • In VB 6 create a new project with a label (Label1) and a textbox side-by-side (Text1). Set the Index property to 0. This will set up a control array. Add the following code to the form: Option Explicit Private Function mfPixelsToTwips(ByVal vlngPixels As Long) As Long mfPixelsToTwips = vlngPixels * 15 End Function Private Sub Form_Load() Dim llngIndex As Long For llngIndex = 1 To 5 Load Label1(llngIndex) Label1(llngIndex).Top = Label1(llngIndex - 1).Top + Label1(llngIndex - 1).Height + mfPixelsToTwips(3) Label1(llngIndex).Visible = True Load Text1(llngIndex) Text1(llngIndex).Top = Label1(llngIndex - 1).Top + Label1(llngIndex - 1).Height + mfPixelsToTwips(3) Tex
dcterms:subject
abstract
  • In VB 6 create a new project with a label (Label1) and a textbox side-by-side (Text1). Set the Index property to 0. This will set up a control array. Add the following code to the form: Option Explicit Private Function mfPixelsToTwips(ByVal vlngPixels As Long) As Long mfPixelsToTwips = vlngPixels * 15 End Function Private Sub Form_Load() Dim llngIndex As Long For llngIndex = 1 To 5 Load Label1(llngIndex) Label1(llngIndex).Top = Label1(llngIndex - 1).Top + Label1(llngIndex - 1).Height + mfPixelsToTwips(3) Label1(llngIndex).Visible = True Load Text1(llngIndex) Text1(llngIndex).Top = Label1(llngIndex - 1).Top + Label1(llngIndex - 1).Height + mfPixelsToTwips(3) Text1(llngIndex).Visible = True Next End Sub Private Sub Text1_GotFocus(Index As Integer) Label1(Index).Tag = Label1(Index).Caption Label1(Index).Caption = "Enter-->" End Sub Private Sub Text1_LostFocus(Index As Integer) Label1(Index).Caption = Label1(Index).Tag End Sub This illustrates how VB deals with a single event handler for multiple controls. There is a better way with Delphi.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software