It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Hello ladies and gentleman,
I am a teacher for kids in the kindergarten.
I've decided to create a program in visual basic which would teach young kids colour names in english.
Although, my knowledge in programming is nothing very great.
Here is what I want to do
Button is clicked and the game begins.
New button appears.
Label changes its text to one of the colour names.
Picture box changes its content to random colour and continues to change every second.
If they click on a button when picture in picture box is equal to label text colour name they get one point!
I was wondering if anyone could help me out on this one.
Any help would be very much appreciated.
Many thanks in advance
First, you'll need to create a list of all of the colors from which you want the application to randomly choose. Something like this would work:
Dim colors() As Color = {Color.Red, Color.Blue, Color.Green}
Then, you can sort the array into a random order, like this:
Dim r As New Random()
Dim randomColors() As Color = colors.OrderBy(Function(x) r.Next()).ToArray()
Then you can just show them in that order. To show the first one, you could do something like this:
PictureBox1.BackColor = randomColors(0)
Label1.Text = randomColors(0).Name
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
My app is based on Visual Basic 2010/2012 (all its codes are same for both the languages). I want that I open a Registration Form above the parent form such that responding to the registration form becomes necessary for the user just like a message box. Can you suggest me a code. And please don't suggest very complex one. It irritates. :)
Thanks in advance.
Open your registration form using ShowDialog()
Dim f As frmRegistration = new frmRegistration()
f.ShowDialog()
The ShowDialog method is used to display a modal dialog box.
A modal dialog box blocks the execution of code following the call until the dialog box is closed.
use ShowDialog rather than Show
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can anyone help me because I want to disable the checkboxes in a treeview and at the same time be able to scroll through the treeview.
Create a new class and copy the code below
Imports System.Windows.Forms
public class MyTreeView
Inherits Treeview
Protected Overrides Sub WndProc(ByRef m as system.Windows.Forms.Message)
if m.Msg = &H203 THEN
m.Result = IntPtr.Zero
else
MyBase.WndProc(m)
End If
End Sub
Compile your project and either drag and drop this new control from your toolbox or go to your designer and rename System.Windows.Forms.Treeview to MyTreeview.
Go to your vb Code and on BeforeCheck event say e.Cancel = true
Done!!!
If you need any help post your comment.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am trying to implement and learn Silverlight Databinding using lab giving http://www.silverlight.net/learn/data-networking/binding/silverlight-data-binding. I do everything as soon in the lab but some how, I am not able to filter item into Listbox, even though, I am able to see item in listbox. Also, when I select any item in list box it doesn't show up text in textbox using public class for binding but when I do Element binding with Listbox then it do display the text in textbox.
I double check the code giving in lab everything looks similar but I am not able to get Databinding working.
Check Your DataContext Is proper. Check Means it may be possible spelling mistake. otherwise it is difficult to say what's the mistake in your code without see it.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I decide to use button to display AM/PM, when click on the button I want to change button text as AM to PM. Is it possible?
Something like this:
If button1.Text = "AM" Then
button1.Text = "PM"
Else
button1.Text = "AM"
End If
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
how can i getting data from listbox in second form named listform while i am at first form
i have search it a lot on google but not find any usefull ans...
I see these questions all the time
Create two forms one called form1 the other from2 drop a button on form 1 and a list box on from two use the defalut names for everything and put this code in your button click handler.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As New Form2()
f.Show()
f.ListBox1.Items.Add("Added somthing")
End Sub