CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    15

    whats wrong wit my code?

    this is friends code but i am having problems with it too!

    Option Explicit
    Public strHidden As String

    Private Sub cmdHide_Click()
    strHidden = txtHide.Text
    txtHide.Text = ""
    frmShow.Show
    End Sub

    *********************

    Option Explicit

    Private Sub cmdShow_Click()
    txtShow.Text = strHidden
    End Sub

    [Cimperiali: title changed to make it related to question]
    Last edited by Cimperiali; October 15th, 2003 at 02:51 AM.

  2. #2
    Join Date
    Sep 2003
    Location
    Washington
    Posts
    143
    What exactly are you changing?
    -squaK

  3. #3
    Join Date
    Sep 2003
    Posts
    15
    im trying to make txtHide.Text and txtshow.text the same text

  4. #4
    Join Date
    Apr 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    1,792
    It works fine for me.

    Create a module, paste this into the module

    Code:
    Option Explicit
    
    Public strHidden As String
    Create a form (form1), add a text box & a command button called by the obvious names, add this code to it.
    Code:
    Option Explicit
    
    Private Sub cmdHide_Click()
    strHidden = txtHide.Text
    txtHide.Text = ""
    frmShow.Show
    End Sub
    Create another form (frmShow), add a text box and command button, then add this code.

    Code:
    Option Explicit
    
    Private Sub cmdShow_Click()
    txtShow.Text = strHidden
    End Sub
    Now, do ctrl-f5, type some text into txtHide, and click the button.
    When frmShow is displayed, click the cmdShow button, and the text appears.
    Be nice to Harley riders...

  5. #5
    Join Date
    Sep 2003
    Posts
    15
    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured