Segna il video come già completato  
Se vuoi, sarebbe utile un giudizio su questo video    
Nel video precedente abbiamo creato la nostra applicazione chiamata prima applicazione WF dove WF sta per Windows Form e ci si è presentato quindi la pagina di progettazione dell'applicazione. La pagina di progettazione è suddivisa come possiamo vedere in tre blocchi escludendo la zona superiore che ospita la toolbar, ed il classico menù di Visual Studio 2010. Vediamo adesso di capire bene che cosa sono questi tre riquadri e come poter utilizzarli. Il riquadro centrale che è questo più grande nell'area centrale dello schermo, é l'area di lavoro principale dell'ambiente di sviluppo di Visual Basic 2010 perché ci permette di lavorare sull'interfaccia dell'applicazione che è questa qui come possiamo vedere cioè la finestra che si presenterà all'utente che utilizzerà il nostro software. E allo stesso modo ci permette di lavorare anche sul codice cioè sul motore della propria dell'applicazione. Infatti possiamo switchare, possiamo passare da una modalità all'altra la modalità interfaccia e la modalità codice semplicemente premendo l'uno o l'altro pulsante. Quindi il pulsante "visualizza codice" farà vedere il codice dell'applicazione e il pulsante "visualizza finestra di progettazione" ci farà vedere la finestra di progettazione dell'interfaccia dell'applicazione. Quindi sottolineando il primo concetto fondamentale della progettazione di un'applicazione Visual Basic 2010 è il fatto che un'applicazione è divisa in due livelli logici cioè il livello dell'interfaccia e livello del codice. Il livello dell'interfaccia rappresenta la faccia che ha la nostra applicazione e mentre il livello del codice rappresenta il motore logico cioè quello che l'applicazione fa in concreto. Il livello dell'interfaccia consente all'utente finale della nostra applicazione di interagire con il nostro codice, quindi sarà lo strumento attraverso il quale il nostro utente andrà ad interagire con il programmatore. Andiamo avanti ad analizzare i riquadri dell'ambiente di sviluppo di Visual Basic 2010 abbiamo questo riquadro in alto a destra che ci presenta l'elenco di tutti i file e dell'applicazione. Abbiamo nel primo nodo di questo albero non è altro che il nome del nostro progetto e se ci ricordiamo avevamo dato come nome del progetto "prima applicazione WF" di seguito compariranno tutti i nomi dei file coinvolti in questo progetto, ad esempio Form1. Form1 è il form che fa riferimennto alla finestra che vediamo in quest'area di progettazione. Se avessimo un'applicazione composta da più finestre ad esempio una finestra principale più una finestra di informazioni sull'applicazione, allora avremo qua due form e quindi due file con questa stessa icona. Abbiamo poi la finestra delle proprietà, che è questa qua sotto. Nel riquadro delle proprietà sono elencate tutte le caratteristiche dell'oggetto che sta nella finestra di progettazione per cui ad esempio se le ho selezionato l'intera finestra vedrò elencate in questo riquadro tutte le proprietà dell'intera finestra. Se avessi un controllo posto sulla finestra allora selezionando tale controllo vedrei è in questo riquadro delle proprietà tutte le proprietà associate al controllo pulsante che ho selezionato per cui riassumendo la riquadro delle proprietà non fa altro che elencare tutte le caratteristiche del controllo attualmente selezionato nella finestra di progettazione spesso rimuoviamo questo controllo dal forum e vediamo di modificare alcune proprietà di questa finestra come già detto questa finestra non sarà altro che l'interfaccia che vedrà l'utente per cui sarà nella finestra e sulla quale dovremo andare a mettere tutti controlli della nostra applicazione possiamo già vedere in anteprima della nostra applicazione che per il momento è vuota in anteprima la potremo vedere semplicemente cliccando su questo pulsante avvia di padre oppure alternativamente premendo il pulsante di cinque premiamo il pulsante e vediamo come ci si presenterà l'applicazione dopo qualche secondo necessaria per compilare la nostra applicazione possiamo vedere possiamo vedere quello che vedrà l'utente finale è cioè una finestra attualmente vuota da possiamo chiudere e ritornare nell'area di progettazione quindi abbiamo visto un altro concetto importante della programmazione Visual Basic 2010 cioè che per avviare un progetto per compilare il progetto e vedere qual è il risultato finale, è sufficiente premere questo pulsante avvia debug oppure alternativamente premere F5. Come abbiamo potuto vedere dall'ultima compilazione che abbiamo fatto premendo questo pulsante non la finestra e che si presenterà l'utente e una finestra completamente vuota e quindi l'applicazione e diciamo totalmente inutile. Quello che ci serve adesso è di dare un aspetto un po' più professionale a questa finestra e vedere di riempirla con dei controlli che permettano all'utente di interagire con il nostro codice. Prima di tutto vediamo di modificare quello che è il nome proprio dell'applicazione cioè quello che l'utente riconosce come il nome dell'applicazione, ossia il titolo. Come vediamo dal titolo di questa finestra Form1 rappresenta un nome standard Form per Microsoft sono belle queste finestre di progettazione. Quindi invece di Form1 indichiamo un nome più significativo per il titolo dell'applicazione. Come abbiamo detto prima, cliccando sulla finestra nel riquadro delle proprietà, compariranno tutte le proprietà associate alla finestra selezionate tra queste proprietà troviamo anche Text che non è altro che il testo della finestra ossia il testo della barra superiore di questo form. Andiamo quindi a sostituire al Form1 il nome della nostra applicazione. Ricordiamo che avevamo chiamato l'applicazione "prima applicazione WF" possiamo quindi assegnare il titolo "prima applicazione Windows Form". Possiamo dare invio oppure cliccare su un'area vuota, ed ecco che è cambiato il titolo dell'applicazione. Abbiamo un primo inconveniente un primo bug dell'applicazione, nel senso che il titolo non si vede completamente infatti il titolo della nostra applicazione è tutta questa frase evidenziata sul titolo. Abbiamo invece una frase che è realtà spezzata. Che cosa dobbiamo fare? Le opzioni sono due: o accorciamo la frase che rappresenta il titolo dell'applicazione oppure in modo molto più conveniente vediamo di allargare l'area visibile della finestra per fare questo sfruttiamo questi tre quadratini bianchi che stanno sui bordi della finestra e sono dei riquadri di trascinamento come si può vedere passando il cursore sopra questi riquadri di trascinamento il cursore stesso cambia forma e diventa una doppia freccia. Questo significa che premendo e trascinando il mouse e il bordo della finestra può essere trascinato per allargarla oppure per restringere questo può essere fatto sul bordo inferiore della finestra sul bordo laterale destro oppure su tutte due premendo quest'angolo in basso a destra. Vediamo che modificando le dimensioni della finestra è stata resa visibile anche la frase che ho messo come titolo dell'applicazione per cui ci possiamo ritenere sufficientemente soddisfatti di aver risolto il primo bug e di quest'applicazione Visual Basic 2010 adesso che tutto a posto ciò fare il salvataggio dell'applicazione per salvare tutti i file dell'applicazione premiamo questi con alcuni dischetti il pulsante "salva tutto" ci verrà chiesto il percorso di salvataggio dell'applicazione va bene questo percorso standard in cella cartella Project della directory Visual Basic 2010 nere che emesse in documenti e il nome dell'applicazione sarà il nome che abbiamo dato al momento della creazione dell'applicazione in che nel caso in cui nella cartella la directory dell'applicazione non esista è allora verrà creato automaticamente. Premiamo il pulsante salva e la nostra applicazione è stata salvata correttamente.
In the previous video we created our first application called application where WF WF stands for Windows Forms, and then there occurred the page design application. The page design is divided into three blocks as we can see the exclusion of the upper zone that hosts the toolbar, and the classic menu of Visual Studio 2010. Let us now try to understand well what are these three boxes and how to use them. The center box that this is the largest in the middle of the screen is the main work area of the development environment of Visual Basic 2010 because it allows us to work on the interface of the application that this is here as we can see that the window will be presented to the user who will use our software. In like manner also allows us to work on the code that is the engine of your application. In fact, we can switch, we can move from one mode to another mode interface and how the code by simply pressing a button or another. So the "View Code" will see the application code and the button "View Designer" we will see the designer of the application interface. Thus underlining the first fundamental concept of designing a Visual Basic 2010 is the fact that an application is divided into two logic levels that the level of the interface and code level. The interface layer is the face that our application and while the level of the Code represents the logic engine that is what the application does in practice. The level of the interface allows the end user of our application to interact with our code, and will be the instrument through which our users will interact with the programmer. Let's go on to analyze the frames of the development environment of Visual Basic 2010 we have this box in the upper right corner that presents a list of all files and application. We have the first node of this tree is simply the name of our project and if we remember how we gave the name of the "first application WF" will appear below the names of all files involved in this project, such as Form1. Form1 is the form that makes riferimennto the window we see in this design. If we had an application consists of multiple windows such as a main window as a window of information about the application, then we will have two forms here, and then two files with the same icon. Then we have the property that is below this. In the Properties pane lists all the characteristics of the object that is in the designer so for example if I selected the entire window I see listed in this box all the properties of the entire window. If I had a place on the control window, then selecting this check I would see this is in the Properties pane, all the properties associated with the control button, which I selected for summing up the properties pane does is list all the features of the currently selected control in the dialog design often we remove this check from the forum and let's change some properties of this dialog box as I said this will be just the interface that the user will be so in the window and on which we going to put all controls of our application We can already see a preview of our application that is empty for the moment we see in the preview by clicking on this button starts a father or alternatively by pressing the button press the button five and see how you present the application after a few seconds necessary to fill out our application we can see what we can see that the end user will see a window that is currently empty we can close and return to the design and then we saw another important concept in programming Visual Basic 2010 that is, to start a project to compile the project and see what the end result, just press this button start debugging, or alternatively press F5. As we have seen since the last compilation that we did not press this button and the window will show the user a completely blank window and then the application and say, totally useless. What we need now is to give a somewhat 'more professional in this window and see fill it with controls that allow the user to interact with our code. First of all, let's change what is the proper name of the application which is what you accept as the application name, ie the title. As we see from the title of this window is a standard name Form1 Forms for Microsoft these are good designers. So instead of Form1 indicate a more meaningful name for the title of the application. As we said before, clicking on the box in the Properties pane, you see all the properties associated with the selected window between these properties are also Text, which is nothing but the text of the window or the text of the top bar of this form. Come to the Form1 and then replace the name of our application. Recall that we called the application "before applying WF" we can then assign the title "first Windows Forms application. We can give sending or click on a blank area, and here that has changed the title of the application. We have a first drawback of applying a first bug in the sense that the title can not be seen completely in fact the title of our application is highlighted throughout this phrase on the title. Instead, we have a phrase that is actually broken. What should we do? There are two options: either shorten the sentence is the title of the application or see so much more convenient to enlarge the visible area of the window to do this we use these three white squares that are on the edges of the window frames and are drag as can be seen passing the cursor over these boxes to drag the cursor itself changes shape and becomes a double arrow. This means that clicking and dragging the mouse to the edge of the window can be dragged to enlarge or to restrict this can be done at the bottom of the window on the right side edge or two on all this part by pressing the bottom right corner. We see that changing the size of the window was made visible the phrase that I put as the title of the application for which there may be sufficiently satisfied to have solved the first bug of this application and Visual Basic 2010 now that everything's OK, what do saving the application to save all the files of the press with some of these discs the "save everything" we will be asked where to save the application is fine in this process standard cell directory Directory Project Visual Basic 2010 black issued in the name of the document and is the name that we gave when you created the application in that folder where the directory does not exist is then automatically created. Press the Save button and our application has been saved successfully.