Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

C# // Visual Studio // OnPaint, Custom Controls, Mouse Events Assignment

C# - Microsoft Visual Studio, Windows Forms

Topics: OnPaint, Custom Controls, Mouse Events

Instructions: 

Student will make the first of three parts of a project that will eventually be combined to form a tile editor application. In this first part, the tile selection control will be created.

This tile selection control is made up of two forms and a custom control that you will build. The custom control will contain an image that shows a tileset. A grid will need to be drawn separating each tile from the others, this can be done in the OnPaint method. When a tile is clicked (single- or double-clicks or both if you want to) the tile that was selected should be stored in a property of the control in some way and the currently selected tile should have a different color outline in the grid than the other tiles. Only one tile should be selectable at a time, so selecting a different one should deselect the original. The tile in position 0,0 should be selected by default.

The main form will contain the custom control as well as a ToolStrip and a StatusStrip. The StatusStrip should simply display a string that tells the user which tile is currently selected. The ToolStrip should contain a button for selecting a different tileset image and another button for opening a separate form with options for modifying the selectable grid in the custom control.

The grid options form will allow the user to change the height and width of the selectable grid rectangles. They can also change the number of tiles by adjusting the height and width of the grid.

A demo executable for this application can be downloaded in the attatchments.

Tilesets that you can test your lab with are located in the attatchments.

These are the guidelines used by the grading rubric:

Custom Control: Properties and Events

  • Values that need to be accessed from the other forms are stored as properties of the control. (tile height, tile width, selected tile, etc.)

  • A tile can be clicked or double clicked to set that tile as the selected tile. Only one tile can be selected at a time.

  • The tileset image can be changed.

Custom Control: Grid Drawing

  • Grid that separates each tile is drawn.

  • Selected tile is surrounded by a different color from the rest of the grid.

  • Grid dimensions for height and width of each rectangle can be modified.

  • Grid dimensions for number of tiles in terms of number of columns and rows can be modified.

Main Form

  • ToolStrip is used for access to loading a new tileset image and the grid options.

  • StatusStrip uses text to indicate which tile is selected.

  • Contains an instance of your custom control.

Extra Information

Go back through your code and check for the following:

  • Your application must compile and must not crash when starting up.

  • All variables and methods are named appropriately.

  • Input controls are appropriately labeled.

  • Any information being output to the user should be clear and concise.

  • Make sure nothing accesses an object that doesn’t exist.

  • Add comments to your code to indicate that you know what each line does.

*** DONT FORGET TO DOWNLOAD THE ATTACHMENTS ***

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question