[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

I have a lightswitch screen and want to change a number of labels if the date changes.  How do I test if screen is initialized?

Posted on 2014-12-14
3
Medium Priority
?
95 Views
Last Modified: 2014-12-19
I don't want the this.FindControl("RoomBookings").ControlAvailable += ChangeHeader; when the form hasn't been initialized yet.

        partial void ParameterFromDate_Changed()
        {
           
            if ({Need a test here to make sure the form has been initialized first.  Causes error since form isn't setup yet})
            {
                this.FindControl("RoomBookings").ControlAvailable += ChangeHeader;
            }
        }
0
Comment
Question by:Peter H.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:ChloesDad
ID: 40499376
Why not put a timer control on the form. Then the timer_elapsed event will only fire if the form is in memory so you wont need to check if the form is in memory.

You can then trigger the timer every few seconds, and check if the date is different from the last time the event fired using a private variable in the form. When you do see a change you can change the labels as required.
0
 

Accepted Solution

by:
Peter H. earned 0 total points
ID: 40499383
Actually I just solved it a few min ago.  

Added a property
public Boolean FirstTime = true;

        partial void ParameterFromDate_Changed()
        {
           
            if (this.FirstTime == false )
            {
                this.FindControl("Bookings").ControlAvailable += ChangeHeader;
            }
            this.FirstTime = false;
0
 

Author Closing Comment

by:Peter H.
ID: 40508797
Found a workaround that worked.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question