locked
set object reference help needed RRS feed

  • Question

  • User-549004558 posted

    Hi

    This problem is driving me crazy, despite googling, searching etc

    In VB.net I have a form (called Stats) with a textbox and a button

    Default value of the textbox = "AAA"

    With a buttonclick I have the following code

        Private Sub btnTesten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTesten.Click
            Call Algemeen.TestRef()
        End Sub

    Algemeen is a module as follows:

    Public Function TestRef()

        effe = new Stats ''''éffe has been already declared as public in another Module (Public effe As Stats)

        effe.TextBox1.Text = "BBB"

    End Function

    When the app returns to the form Stats the Textbox1.text is still 'AAA' in stead of 'BBB'

    What am I doing wrong ?

    Help is appreciated

    Monday, August 29, 2011 9:08 AM

Answers

All replies

  • User960609757 posted

    Hi,

    How to set the initial value ("AAA")?

    if you are assign the initial values using Page_Load, set the value within the IsPostBack condition.

    IsPostBack condition
    Monday, August 29, 2011 9:45 AM
  • User-549004558 posted

    Thanks for fast reply.

    It is not ASP.net what I am talking about, it is VB.net (Windows-form).

    (I am in the right forum, though?). The value "AAA" is set in the properties in the IDE and I am trying to modify that with aboven mentioned code.

    Any idea ?

    Monday, August 29, 2011 10:00 AM
  • User-578657687 posted

    Hi,

    I am in the right forum, though?).

    For winform issue please migrate your post to this:

    http://windowsclient.net/Forums/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 1, 2011 3:19 AM
  • User-549004558 posted

    Hi,

    I am in the right forum, though?).

    For winform issue please migrate your post to this:

    http://windowsclient.net/Forums/

    Thanks, will do

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 1, 2011 7:35 AM