-ang loop is just to initialize the textbox ky dli ka ka read/write sa imng textbox if wla pa cya na initialize
-JTextField is java equivalent sa TextBox
-inig saturday nlng bro sa bos..
Pwedi pud magHimo ka og user-defined(custom control) nga textbox dn magAdd ka property para index nya. Then iManual lang nimo og set ang index. (e.g. txtBox.IndexX = 0; txtBox.IndexY = 1).
Last edited by Maikeru; 07-23-2009 at 01:47 PM.
to make it clear, kanus.a dy nmu gus2 mahimo ang textboxes? at runtime or defined na ang array of textboxes nmu?
ang suggestion ni josephG kay at runtime xa himuon ang mga textboxes depende sa row and column na ispecify sa user..
and much better if at runtime kay muspecify nia ang user ug index na outside sa bounds sa imung gcreate na array of textboxes (e.g. max ra kay 3,3 -- based sa imung ui)...
i think you can draw the textboxes on your display
after that you can add them in in an array.
from there you work with the array, and not the actual object names, since they are by reference.
Code:Textbox[,] TextBoxes; private void Main_Load(object sender, EventArgs e) { this.InitializeData(); TextBoxes = new TextBox[4,4]; TextBoxes[0,0] = this.textbox1; TextBoxes[0,1] = this.textbox2; TextBoxes[0,2] = this.textbox3; TextBoxes[0,3] = this.textbox4; ....... } private void DoSomethingToTextboxes() { TextBoxes[0,3].Text = "setSomValue"; }
private Main_Load(..,..) would be the event EventHandler delegate method when your form loads. You can have this method when you doubleclick your form, then put you codes for the Textboxes things...
Regarding TextBox[,] TextBoxes, you put it before your form constructor.
Similar Threads |
|