.net - Should you use variables or properties, and global or static variables in a class? -
i'm new in .net programming.
i have class form1 includes button1_click event. (button1_click creates multiple text boxies @ run time)
here class:
public class form1 dim shiftdown integer dim counter integer private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load end sub private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click dim textbox1 new textbox counter += 1 shiftdown = shiftdown + 30 textbox1.name = "textbox" + counter.tostring() textbox1.size = new size(170, 10) textbox1.location = new point(10, 32 + shiftdown) textbox1.visible = true groupbox1.controls.add(textbox1) end sub
end class
currently rows:
dim shiftdown integer
dim counter integer
defined global variables.
my question is, instead of way are, should define these variables properties or static local variables in button1_click event?
if want learn how architect .net application urgently suggest watch video jason dollinger available here: lab49 archives
it great , covers of relevant issues 1 comes across when in need of building proper wpf / mvvm / .net application
Comments
Post a Comment