Skip to main content

XI IT Assignments - Controls: Events & Properties

Hello Programmers,
Run through this tutorial cum assignment to get a hang of various controls, their properties and the most used events associated with these controls. Try the following and send me the answers or the codes (zip all files - frm & vbp - and send) on the mail id: events@abhinav.ac.in

Form
This is the most basic control. You have already seen some events on this object.
  1. What is the sequence in which the events Activate, Load & Open occur? To find out, write a simple code for each of these events to display a msgbox saying that the event has occured. Now run the program. One by one the messages will popup showing you what happens and in which order.
  2. What does the KeyPress event do? To find out trap this event, i.e. write a small code at this event, say like - MsgBox "Hello". Now run the program and try pressing a key ...
  3. What do the MouseUp and MouseDown events do? Trap these events like described above and find out the difference between the two states of the mouse buttons - Down (pressed) and Up (released). Be sure to write different msgboxes (i.e. saying something different) for each event. Maybe you can also try the following - instead of msgboxes, print something different on the form for each event.
  4. How can you change the background of the form from within the code? At form_click write a code to change the property of the Form.BackColor property (mind the dot between Form and BackColor), i.e. set the value of Form.BackColor to something new. Run code and see
  5. What do these properties do - WindowState, Caption & ControlBox? To find out ... write a code at Form_Click which changes the value of these properties (one property at a time). To guess which values work, look at the property in the Property Sheet which pops up when you right click on the form and select "properties".
TextBox
  1. What does the PasswordChar property do? You can either write a code like the ones above to modify this property at run-time or set different values at design-time and then run the program to see what happens.
  2. How does the MultiLine property work? You know how to test a property by now ...
  3. How are the Enabled and Locked properties different? Try setting the values for each in turn and see what happens? Each property has two possible values, so you have to try out four combinations.
  4. What if you trap the Change event and run a msgbox when it occurs? You know how to trap events ... just write a code for that event of that object. In the code write a simple msgbox to say something.
  5. How do the GotFocus and LostFocus events work? Trap them and find out ... You can trap them at the same time as two different codes (one for TextBox_GotFocus and one for TextBox_LostFocus)

Comments

All Time Popular Posts

Annual Day 2023

 After a long hiatus due to covid we finally got most activities on track. The Annual Day function is always a big deal for everyone at Abhinav. It has been a tradition my mother started that the Annual Day will be not a Teacher-managed event, but a Student Initiative. Since when I was a teenager, I was part of this and today 10 years after she passed, I still strive to make it work as she would have. After some hesitation, we began working in early January. I wanted to use an outside choreographer just so that teachers will not be burdened. (They are already struggling with post-covid learning difficulties) But then, an outside guy could never do justice to the Abhinav style of doing things. We always keep in mind that the cultural program should be enjoyable to everyone in the audience and at the same time should display as many of the diverse talents that our students have, as possible.  It was a great relief that my G3 students came to the rescue. Almost all of std 9 and many of st

Are Self-Driving Cars Taking Over Humans?

- Arya Dharmadhikari(Std X, Abhinav Vidyalay) The 21st century has played an important role in the advancement of technologies. This development has even revolutionized the Automobile industry. We have developed from fuel-efficient vehicles to Hybrids and EVs and now we are enhancing self-driving vehicles. Tesla, Waymo, Volvo, GM, BMW, Mercedes are among the few companies that have started testing self-driving cars. The leading among them is Waymo, which has developed level 4 autonomy which we will discuss in the next section. So before reaching levels of autonomy we should understand what self-driving cars are and why we require them. What is a self-driving car? A self-driving car (also called an autonomous vehicle) is a car that is competent in driving itself without any human intervention. The car has sensors, cameras, lasers, radars, GPS, LIDAR through which the Artificial Intelligence senses the surrounding environment, this helps the car to navigate on its path and to detect sig

Dark Matter

  ~Anvi Patil(X th A Abhinav Vidyalay) In the universe, there is about 25% of dark matter and 70% of dark energy but only 5% of it is visible. What is Dark Matter? It is a non-luminous material, which holds two galaxies. This cannot be called a black hole because it does not bend light. Then the question arrives, as it is non-luminous, how did we detect it? As it is not visible, scientists have found indirect methods to find more about it. One such method is by using the Fermi Gamma-Ray Space Telescope . Gamma rays are released when two particles of dark matter collide, Fermi telescope can be used to detect this collision. This topic was discovered by Fritz Zwicky in the 1930s, he discovered that galaxies were rotating at a faster rate than usual. A dark region seen in the foreground of a star field. This dark region could be a dark cloud of gases like hydrogen, left over from the formation of our galaxy Dark matter is called ‘dark’ not because it is ‘black’ but because it does not