WorkSheet4 - CSE 459.24 Programming in C# In-Class...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 459.24 – Programming in C# Roger Crawfis In-Class Worksheet #4 Creating a Windows Forms application with Data Binding You should have Visual Studio 2008 open. 1. Create a new Project either from the shortcut on the Start page or through the file menu, 2. Select the type to be a C# Windows Forms 3. In the Location textbox, enter your desired hard drive location. Note, that this will be on the mounted z: drive in the CSE environment. Name the Project Lastname VideoCollection where Lastname is replaced with your name or an alias. 4. Select OK. Create the VideoCollection application: We are going to create a simple data entry system for movies or videos. My implementation is illustrated on the right. 5. Right-click on Form1.cs in the Solution Explorer and select Rename. Change Form1.cs to MyVideoForm.cs. You will be prompted to change the name throughout the solution. Click yes. 6. Change MyVideoForm’s Text to something more meaningful for the title bar. 7. Drag a MenuStrip over to the form. Click the little Tasks icon and select Embed in ToolStrip Container. Note, in general you will only want to do this with Toolbars, but I want to demonstrate the ToolStrip Container. Make sure the GripStyle of the menu is set to visible. Add a File and a Video menu items. Under File, add “Open …”, “Save Library …”, and “Exit”. Under Video, add “New Video”. Note: By convention (and user interface studies and research), we add ellipsis to the end of Menu names when the user will be prompted for more information. In this case, we are indicating to the user that Open and Save Library will prompt the user for additional information. Ideally, selecting a menu with an ellipsis should be free from any side effects. In other words, the user should be able to cancel the operation and return to the same state as before selecting the menu item. 8. Drag a SplitContainer to the form. Change its Orientation to Vertical and position the splitter similar to the example. 9. Drag a ListBox to the left panel of the split container. Set its Dock property to Fill. 10. Drag a TableLayoutPanel to the right side of the panel. Give it 7 rows and 2 columns. Add labels to the first column for the first 5 rows as shown in the figure. 11. Add the following controls for the indicated label: Title: TextBox Category: ComboBox Director: TextBox Year: NumericUpDown. Set its minimum value to 1920 and maximum value to 2020.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Duration: DateTimePicker. Set is Format to Custom, the CustomFormat to h:mm and the ShowUpDown to true. 12. Drag a Rich Text Box to column 1, Row 6 of the TableLayoutPanel. In the Properties window note that there are properties for this (and all of the controls add to the table) for the column and row. This should say column 0 and row 5. Set the ColumnSpan property to 2. This will have the control span across both columns. Set its Dock property to Fill. A rich text box is like a simple MS word viewer. It allows hyperlinks, images, text formatting, etc.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

WorkSheet4 - CSE 459.24 Programming in C# In-Class...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online