monster9999
Member
Hello,
i´ve got a problem with adding events
my code:
for example: I want to add a Scroolbar ("ScroolBar1") on a TabControl (tbc2)
'ScrollBar1
' Create
ScrollBar1.New1("Form1",0,0,10,245,true)
ScrollBar1.Maximum = 110
ScrollBar1.Minimum = 0
'Add ScroolBar1 on tabControl
tbc2.AddControl(Scrollbar1.ControlRef,0,222,0)
'Event
AddEvent("Scrollbar1",ValueChanged,"ScrollBar1EventValueChanged")
Sub ScrollBar1EventValueChanged
tbc2Label1.Top = 15 - ScrollBar1.Value
tbc2Label2.Top = 27 - ScrollBar1.Value
tbc2Label3.Top = 59 - ScrollBar1.Value
tbc2Label4.Top = 91 - ScrollBar1.Value
tbc2Label5.Top = 150 - ScrollBar1.Value
tbc2Label6.Top = 162 - ScrollBar1.Value
tbc2Label7.Top = 194 - ScrollBar1.Value
tbc2Label8.Top = 226 - ScrollBar1.Value
tbc2Label9.Top = 278 - ScrollBar1.Value
tbc2LabelA.Top = 130 - ScrollBar1.Value
tbc2LabelB.Top = 265 - ScrollBar1.Value
tbc2LabelC.Top = 317 - ScrollBar1.Value
tbc2textbox2.Top = 39 - ScrollBar1.Value
tbc2textbox3.Top = 71 - ScrollBar1.Value
tbc2textbox4.Top = 105 - ScrollBar1.Value
tbc2textbox5.Top = 174 - ScrollBar1.Value
tbc2textbox6.Top = 206 - ScrollBar1.Value
tbc2textbox7.Top = 238 - ScrollBar1.Value
tbc2textbox8.Top = 290 - ScrollBar1.Value
End Sub
i get the message: object reference not set to an instance
it doesn´t happen only with this event....the same happens with the next event i try to add!
'Textbox "tbc2textbox2"
' Create
AddTextBox("form1","tbc2textbox2",0,0,150,15,"0")
tbc2textbox2.Color = cGray
tbc2textbox2.FontColor = CBlue
' Add TextBox on tabControl
tbc2.AddControl("tbc2textbox2",0,15,39)
tbc2textbox2.BringtoFront
' Events AddEvent("tbc2textbox2",LostFocus,"tbc2textbox2LostFocus")
Sub tbc2textbox2LostFocus
tbc2LabelA.Text = tbv2textbox2.Text + tbv2textbox3.Text +tbv2textbox4.text
End Sub
I hope someone can help me!
:sign0085:
Karl
i´ve got a problem with adding events
my code:
for example: I want to add a Scroolbar ("ScroolBar1") on a TabControl (tbc2)
'ScrollBar1
' Create
ScrollBar1.New1("Form1",0,0,10,245,true)
ScrollBar1.Maximum = 110
ScrollBar1.Minimum = 0
'Add ScroolBar1 on tabControl
tbc2.AddControl(Scrollbar1.ControlRef,0,222,0)
'Event
AddEvent("Scrollbar1",ValueChanged,"ScrollBar1EventValueChanged")
Sub ScrollBar1EventValueChanged
tbc2Label1.Top = 15 - ScrollBar1.Value
tbc2Label2.Top = 27 - ScrollBar1.Value
tbc2Label3.Top = 59 - ScrollBar1.Value
tbc2Label4.Top = 91 - ScrollBar1.Value
tbc2Label5.Top = 150 - ScrollBar1.Value
tbc2Label6.Top = 162 - ScrollBar1.Value
tbc2Label7.Top = 194 - ScrollBar1.Value
tbc2Label8.Top = 226 - ScrollBar1.Value
tbc2Label9.Top = 278 - ScrollBar1.Value
tbc2LabelA.Top = 130 - ScrollBar1.Value
tbc2LabelB.Top = 265 - ScrollBar1.Value
tbc2LabelC.Top = 317 - ScrollBar1.Value
tbc2textbox2.Top = 39 - ScrollBar1.Value
tbc2textbox3.Top = 71 - ScrollBar1.Value
tbc2textbox4.Top = 105 - ScrollBar1.Value
tbc2textbox5.Top = 174 - ScrollBar1.Value
tbc2textbox6.Top = 206 - ScrollBar1.Value
tbc2textbox7.Top = 238 - ScrollBar1.Value
tbc2textbox8.Top = 290 - ScrollBar1.Value
End Sub
i get the message: object reference not set to an instance
it doesn´t happen only with this event....the same happens with the next event i try to add!
'Textbox "tbc2textbox2"
' Create
AddTextBox("form1","tbc2textbox2",0,0,150,15,"0")
tbc2textbox2.Color = cGray
tbc2textbox2.FontColor = CBlue
' Add TextBox on tabControl
tbc2.AddControl("tbc2textbox2",0,15,39)
tbc2textbox2.BringtoFront
' Events AddEvent("tbc2textbox2",LostFocus,"tbc2textbox2LostFocus")
Sub tbc2textbox2LostFocus
tbc2LabelA.Text = tbv2textbox2.Text + tbv2textbox3.Text +tbv2textbox4.text
End Sub
I hope someone can help me!
:sign0085:
Karl