Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2007, 10:00 AM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form Loosing Data

Hi

I have Two forms
frmMain and frmChild

in frmMain_Load, I am calling a function in frmChild which loads data into the textboxes of frmChild
Call frmChild.LoadData()

and after that I am saying frmChild.Show()

Problem is, once frmChild is loaded its not showing any data. I tried to debug and LoadData is calling correctly and assigning values to textboxes and somehow after calling Show(), they are loosing data..

Class definition for both forms is:
Friend Class frmMain
    Inherits System.Windows.Forms.Form

Friend Class frmChild
    Inherits System.Windows.Forms.Form


How to solve this issue..

I am using Visual Studio 2005, Win Forms.

Thanks

 
Old June 14th, 2007, 08:12 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is it possible that the form is getting initialized after you call the LoadData method and this is clearing the value that LoadData puts in? This seems like the only explanation to me.

Can you describe the lifecycle of the form? When is the form instance created?

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Loosing work Patc4 VB.NET 2002/2003 Basics 4 March 28th, 2008 08:14 AM
Saving Form Data Earl Hickey ASP.NET 1.0 and 1.1 Basics 5 July 25th, 2006 01:10 PM
Loosing a reference?? mega C# 1 November 27th, 2004 06:32 PM
Form Data Edits bph Access VBA 6 January 26th, 2004 11:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.