Visual Basic Express 2010 Tutorial 40 Dynamically Making Objects - EZInvaders Part 9 Game

preview_player
Показать описание
Copy and pasting objects in the form manually does works for small sets of objects. If the application needs 100s of objects then copy and pasting will not work well. What is needed is to dynamically add objects to the form. Make a variable as the object you want to create. Make a new instance of that object, set the properties, then add the object to the controls by using Controls.Add
Рекомендации по теме
Комментарии
Автор

I was looking all over the internet for info on how to do this. Everywhere I looked there was all this stuff about making a whole new class and junk. Finally you have showed me EXACTLY what I needed. Thanks :)

MattScullino
Автор

im surprised this only has 2000 views, its the best VB tutorial on youtube!

lumadroid
Автор

im lucky i found this, exactly what i was looking for.

Flamo
Автор

Hello sir, thanks a lot for all these lecture series.. It helped me lot to learn VB 2010.. Thanks a lot again :)

karthikbadarinath
Автор

Hi, I'm french, and I was looking for tutorials like that during a long time... I "checked" forums and things like that, but i've never get the way to create objects dynamically. So thank you very much, this tutorial is gonna be very helpfull for me

leonoirot
Автор

i love your tutorials! subscribed and waiting for more exciting ones! :)

GLINA
Автор

Is there a way to create a dynamic array or list of objects? I am creating pictureboxes on timer tick, and I need to add each to a collection so that I may refer to them via the index. They should continue to spawn as long as the timer is active. So far I can either add them to an array upon creation OR spawn them dynamically, but not both.

TheCuffmup
Автор

good video, what create controls drag drop and forms runtime and modify properties style VB.net, me explique ?

walney
Автор

Thanks!! that i looking for.
I would like to ask, what should i do if i want the object that i added is on the panel?
because my button is cover by the panel when i adding in..= ="

brownstamp
Автор

OMG: Talking about bad programming practises.
No, wonder Dr. Bob is so mad all the times.

RogerKeulen