Click here to Skip to main content
15,886,773 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Web Explorer Pin
- Zero -15-Mar-07 7:38
- Zero -15-Mar-07 7:38 
GeneralRe: Web Explorer Pin
MatrixCoder15-Mar-07 8:11
MatrixCoder15-Mar-07 8:11 
AnswerRe: Web Explorer Pin
Steven J Jowett16-Mar-07 0:06
Steven J Jowett16-Mar-07 0:06 
QuestionHow to get system temperature,voltage and fans RPM on vb.net 2005 [modified] Pin
Xeqtr15-Mar-07 2:51
Xeqtr15-Mar-07 2:51 
QuestionHow To Make New Form? Pin
Mogtabam15-Mar-07 0:28
Mogtabam15-Mar-07 0:28 
AnswerRe: How To Make New Form? Pin
Tirthadip15-Mar-07 0:53
Tirthadip15-Mar-07 0:53 
GeneralRe: How To Make New Form? Pin
Mogtabam15-Mar-07 3:16
Mogtabam15-Mar-07 3:16 
GeneralRe: How To Make New Form? Pin
Ray Cassick15-Mar-07 7:47
Ray Cassick15-Mar-07 7:47 
Declare the form outside the method (in the global area of the main form, and then create the new form in the button handler. The then the new form object will be available globally within the main form:

Public Class MainForm As Form

  Public Cf as ChForm

  sub But_click()     
    Cf  = new ChForm     
    Cf.show

  end sub

End Class


However, keep in mind that what you want to do (directly access a control on one form from another) is really bad practice. You should be building properties on the other forms and using them to access the data provided in controls on the form as shown bellow:

Public Class MainForm As Form

  Public Cf as ChForm
  Private mNameData As String

  sub But_click()     
    Cf  = new ChForm     
    Cf.show

    mNameData - Cf.NameData()

  end sub

End Class

Public Class ChForm As Form

  Public Property NameData() As String
    Get
      Return txtName.Text

    End Get

    Set (value as String)
      txtName.Text = value

    End Set

  End Property

End Class


This keeps things much cleaner and more modular.


AnswerRe: How To Make New Form? Pin
Navneet Hegde15-Mar-07 2:06
Navneet Hegde15-Mar-07 2:06 
AnswerRe: How To Make New Form? Pin
manni_n15-Mar-07 9:27
manni_n15-Mar-07 9:27 
Questionhow to assign integer value in datagrid template column Pin
Member 387988114-Mar-07 23:47
Member 387988114-Mar-07 23:47 
AnswerRe: how to assign integer value in datagrid template column Pin
Marcus J. Smith15-Mar-07 2:41
professionalMarcus J. Smith15-Mar-07 2:41 
Questionvalidation of textoxes... Pin
manni_n14-Mar-07 23:20
manni_n14-Mar-07 23:20 
AnswerRe: validation of textoxes... Pin
The ANZAC14-Mar-07 23:36
The ANZAC14-Mar-07 23:36 
GeneralRe: validation of textoxes... Pin
manni_n15-Mar-07 5:38
manni_n15-Mar-07 5:38 
GeneralRe: validation of textoxes... Pin
TwoFaced15-Mar-07 10:43
TwoFaced15-Mar-07 10:43 
Generalthanks Pin
manni_n15-Mar-07 11:52
manni_n15-Mar-07 11:52 
GeneralRe: thanks Pin
TwoFaced15-Mar-07 12:27
TwoFaced15-Mar-07 12:27 
GeneralRe: thanks Pin
manni_n15-Mar-07 12:45
manni_n15-Mar-07 12:45 
GeneralRe: thanks Pin
TwoFaced15-Mar-07 12:49
TwoFaced15-Mar-07 12:49 
GeneralRe: thanks Pin
manni_n15-Mar-07 12:55
manni_n15-Mar-07 12:55 
GeneralRe: thanks Pin
TwoFaced15-Mar-07 12:59
TwoFaced15-Mar-07 12:59 
Generalperfect... Pin
manni_n15-Mar-07 13:12
manni_n15-Mar-07 13:12 
Generalcheck it... Pin
manni_n15-Mar-07 13:23
manni_n15-Mar-07 13:23 
GeneralRe: check it... [modified] Pin
TwoFaced15-Mar-07 14:07
TwoFaced15-Mar-07 14:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.