how to use classes and wats wrong if i write the code like this

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seshu
    New Member
    • Nov 2006
    • 156

    how to use classes and wats wrong if i write the code like this

    Hi everybody today i have developed an application which uses the concepts of classes and the code is like this to explain you simply
    i have two forms form1,form2,and a class class1
    in class i wrote this
    Code:
    Public Class Class1  
      Public str As String = ""
    End Class
    in form1 class  one i wrote this code
    dim cls as new class1
    in button click 
      cls.str=textbox1.text
    in another button click
    dim frm as new form2
    frm.show
    in form 2 class
    dim cls1 as new class1
    on form load
    textbox1.text=cls1.str
    now here in this code this the value of textbox1 in form 1 is not coming in form2 textbox some one plzz help me
    Last edited by kenobewan; Feb 21 '07, 12:44 PM. Reason: Add code tags
  • NSRao
    New Member
    • Jan 2007
    • 11

    #2
    try with static clause

    Comment

    • nmsreddi
      Contributor
      • Jul 2006
      • 366

      #3
      Hello

      Is this a webapplication or awindows application

      if you want to get value of textbox that exist in another webform you have to explicitly pass that value as a parameter while you are navigating to other form .other wise you can access textbox by using its form object in another form but you cannot access the value of that text box


      make it clear ant try it out

      Good luck

      Comment

      Working...