Need help creating two dice side by side in visual basic that when the button is
ID: 3817866 • Letter: N
Question
Need help creating two dice side by side in visual basic that when the button is clicked it generates random numbers. The form should consist of a button and two dice that are created using code instead of a function, my teacher is looking for us to use like e.graphics.fill to create them, and if you would like to you can make the dots inside the rectangle by calling it as an object or you can use whatever works best for you. Please dont use any power packet to create them, use all code in visual basics. The final product when done, you should be able to click on the button and it generates random numbers (as dots just like a regular dice.) I will rate highly, thank you so much!
Explanation / Answer
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
Button1.Click += new EventHandler(this.buttonClick);
}
void buttonClick(Object sender,
EventArgs e)
{
Button buttonClicked = (Button)sender;
buttonClicked.Text = "...button clicked...";
buttonClicked.Enabled = false;
label1.Visible = true;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Simple Button Example</h3>
<asp:Button id="Button1"
Text="Click here to start"
runat="server"/>
<br />
<br />
<asp:Label ID="label1" runat="server"
Visible="false" Text="Hello World!" />
</div>
</form>
</body>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.