Page 136 - DCAP408_WEB_PROGRAMMING
P. 136

Windows Programming




                    Notes
                                     Did u know?  What is the use of Open file dialog box?
                                     Use this dialog box to open an existing file from disk. You can also use this dialog box to
                                     open an already opened file using different language encoding options.
                                   We’ll work with these textboxes when we do the Edit menu. So let’s leave them for now.
                                   When we click on File > Open from our menu, we want the Open dialogue box to appear. This
                                   is fairly straightforward in VB.NET. In fact there is even a control for it!
                                   Open up your toolbox, and locate the control called “OpenFileDialog”. You might have to scroll
                                   down to see it. But you’re looking for this:










                                   Double click the control to add one to your project.




                                     Notes  But notice that the control doesn’t get added to your form.

                                   It gets added to the area at the bottom, next to your menu control:





                                   The shaded area surrounding the control means that it is selected. If you look on your right,
                                   you’ll see the properties that you can use with the control.
                                   Click on the Name property and change the name to openFD. When you change the name in the
                                   properties box, the name of the control at the bottom will change:






























          130                               LOVELY PROFESSIONAL UNIVERSITY
   131   132   133   134   135   136   137   138   139   140   141