![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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,"ScrollBar1Even tValueChanged") 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,"tbc2textbox2Los tFocus") Sub tbc2textbox2LostFocus tbc2LabelA.Text = tbv2textbox2.Text + tbv2textbox3.Text +tbv2textbox4.text End Sub I hope someone can help me! ![]() Karl |
|
|||
|
hello,
thank´s for your answer. I suppose, that i unfortunately made this "extra space". in real there is no space in the sub AddEvent("Scrollbar1",ValueChanged,"ScrollBar1Even tValueChanged") it would be a help, when you could tell me, what the error message "object reference not set to an instance" means Thanks Karl |
|
|||
|
i recognize that there still is this extra space posted in my second message... i don´t know why!
so the name of the sub is correct without this space! AddEvent("Scrollbar1",ValueChanged,"ScrollBar1Even tValueChanged") (without space) |
|
||||
|
Quote:
So instead of adding the scrool bar to the tabcontrol, why not add it to the form and make it visible when needed, bringing it to front as well?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I know if an object exists? | jesb4ppc | Questions & Help Needed | 7 | 05-20-2008 11:57 AM |
| remove a object | paul j | Questions & Help Needed | 2 | 12-06-2007 07:40 AM |
| Explore Object | tvrman | Basic4ppc Wishlist | 2 | 08-29-2007 07:29 PM |
| object reference | dennishea | Questions & Help Needed | 6 | 08-15-2007 05:48 PM |
| Tab Object | anansath | Basic4ppc Wishlist | 1 | 06-08-2007 03:58 PM |