Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25
  1. #11

    Quote Originally Posted by josephG View Post
    No declare it ones ra, sa constructor ba..hehe actually la pko ka try og code sa c#..la ko kibaw onsaon pg initialize og 2d array sa c#.. pero assume java og c# pariha ra:


    for(int row=0; row<noRows; row++){
    for(int col=0; col<noCols; col++){
    yourTxtbox[row][col] = new JTextField(); <--ahh samot nako nag libog..what is Jtextfield()? function? and the for loop is to put a value inside each text box? what if 03 iya una sudlan bro
    }
    }



    variable name rana instead og txtbox

    uhmm ang name sa ako txtbox kay txt00,txt11...etc...if i do it the way u said..txt[x][y].Text=value <---error siya that txt does not exist

    sry if daghan questions

  2. #12
    -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..

  3. #13
    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.

  4. #14
    Quote Originally Posted by Deathnote View Post
    uhmm ang name sa ako txtbox kay txt00,txt11...etc...if i do it the way u said..txt[x][y].Text=value <---error siya that txt does not exist

    sry if daghan questions
    naggamit ka ug Visual Studio noh? search sa help how to create an array of controls sa GUI Designer.. you'll find your answers there..

    i'd like to put the steps here, but i dont have visual studio installed anymore..

  5. #15
    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)...

  6. #16
    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";          
            }

  7. #17
    Quote Originally Posted by silent-kill View Post
    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";          
            }
    ahhh finally a code i can understand...hehehe...gonna try this method out

  8. #18
    I agree with silent-kill solution...

  9. #19
    Quote Originally Posted by silent-kill View Post
    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 void Main_Load(object sender, EventArgs e)<---asa man ni nako pangitaon bro?

    and where do i initialize this one? Textbox[,] TextBoxes;

  10. #20
    Quote Originally Posted by Deathnote View Post
    private void Main_Load(object sender, EventArgs e)<---asa man ni nako pangitaon bro?

    and where do i initialize this one? Textbox[,] TextBoxes;
    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.

  11.    Advertisement

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

 
  1. Another C# Problem: Data Picker
    By Deathnote in forum Programming
    Replies: 4
    Last Post: 10-06-2009, 06:36 AM
  2. another problem....huhuh
    By parts in forum Computer Hardware
    Replies: 23
    Last Post: 01-07-2008, 03:51 PM
  3. Connecting to another PC via dial-up ( problems )
    By EarlZ in forum Networking & Internet
    Replies: 7
    Last Post: 01-07-2006, 12:16 AM
  4. Another Day in Paradise
    By n`gel in forum Music & Radio
    Replies: 20
    Last Post: 11-02-2005, 11:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top