Hello, I have a group box (grpButtons) with four radio buttons (radAbortRetryI gnore, radOK, radOKCancel, radYesNo) what I am trying to do is display the buttons in the messagebox based on the selection the user makes with the radio buttons.
MessageBox.Show (txtTitle.Text, txtMessage.Text , grpButtons())
where I have grpButtons() is where Im having the problem, Im trying to have the message box display what the user chooses. Can this be done with an array???? I have tried several different ways and keep getting errors. Any help would be appreciated.
Thank You in Advance. I am enclosing what I have done so far, If I could get a push in the right direction as to how to tie in the radio button selected to the message box i will be able to figure out the rest
P.S. How do I upload the project if need be????
2 10977
Sorry, I am using VB.Net version 2003
if u want use array u can write like this -
Public Class Form1
-
-
Private radChoice(4) As RadioButton
-
Private selectedIndex As Integer
-
-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
radChoice(0) = radChoice0
-
radChoice(1) = radChoice1
-
radChoice(2) = radChoice2
-
radChoice(3) = radChoice3
-
End Sub
-
-
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
-
MessageBox.Show(radChoice(selectedIndex).Text)
-
End Sub
-
-
Private Sub radChoice0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radChoice0.Click, radChoice3.Click, radChoice2.Click, radChoice1.Click
-
Dim rb As RadioButton
-
rb = CType(sender, RadioButton) 'use sender argument to determine wich radio button clicked
-
selectedIndex = rb.Tag 'every tag property of radio button must set first
-
MessageBox.Show(rb.Text) 'just try to show message when radio button click
-
End Sub
-
-
End Class
-
if u just want to show message according to radio button selected -
Public Class Form1
-
-
Private sMessage as String
-
Private selectedIndex As Integer
-
-
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
-
MessageBox.Show(sMessage)
-
End Sub
-
-
Private Sub radChoice0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radChoice0.Click, radChoice3.Click, radChoice2.Click, radChoice1.Click
-
Dim rb As RadioButton
-
rb = CType(sender, RadioButton) 'use sender argument to determine wich radio button clicked
-
sMessage = rb.Text
-
MessageBox.Show(rb.Text) 'just try to show message when radio button click
-
End Sub
-
-
End Class
-
-
Note:
There is only one radio button click event to handle all of radio button.
So every radio button must refer to this event
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Renie83 |
last post by:
Hi all! I was wondering does anyone have any ideas on how I can send
info to a SQL database by choosing a radio button. What I want to do
is set one radio button to "Max" and one to type "Avg". When a user
clicks on a radio button I want the value of whatever button was
chosen to be placed inside the "type" field in my database after they
hit submit. Also, if anyone knows of the best sites or books I can use
about VBScript or ASP please...
|
by: Matt |
last post by:
The following code is try to validate if the user selects a radio button
choice. I dont understand why document.UserInputs.question.value; gets
undefined value even user make a choice. I tried text box and drop down
list, and it works fine.
<html>
<head>
<script type="text/javascript">
function CheckForm()
|
by: Stoic |
last post by:
I'm offering a selection of three items. One is $25, the second is $50, the third is $100.
Along with selection one of the items I need to pass the quantity of the selection. Here is
the code now.
<tr><td><input type="radio" name="item_name" value="Reduced">Reduced</td><td><input
type="radio" name="amount" value="25">$25.00ea.</td></tr>
<tr><td><input type="radio" name="item_name" value="Regular">Regular</td><td><input
type="radio"...
|
by: John Davis |
last post by:
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons.
When the user click the first radio button, the text will change to
uppercase. If the user clicks the other radio button, the text will change
to lowercase.
I added the following event, but still won't able to change the text to
uppercase.
Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles...
|
by: vinay |
last post by:
why are u not using the radiobutton list???
vinay
>-----Original Message-----
>I created a simple ASP.NET application with a text field,
and 2 radio
>buttons (uppercase and lowercase conversion). When the
user enters a text in
>text field, the user can click the radio button for case
conversion. I set
>the property of radio button to AutoPostBack=True, the
| |
by: romano2717 |
last post by:
I used the for loop variable $i to each radio button so that each radio button will have a unique name. the problem now is how can i display the values selected in the radio button on the same page as where the form is located.
your help is greatly appreciated.. thanks
here's the code:
NOTE: this code is cut short, i only posted the part where i got stuck
<?php
if(isset($_GET)){
$num = $_GET;
$num = 2;
for($i=1; $i<=$num; $i++...
|
by: ameshkin |
last post by:
Hi guys,
I'm a pretty good PHP programmer, but when it comes to JS, I just dont
understand it! But I really need to learn. I'm having trouble doing
the simplest thing!
When someone clicks on this image, I want the radiobutton above it to
be checked. Not that hard,but nothing I try seems to work. Can
someone please help me?
|
by: makunta |
last post by:
Hi all,
First here is the website of what I am trying to do: http://www.exmhosting.com/
Locate the login form on the top-right of the page. What I need to do is allow the user to sign into different sections of the website according to the radio button choice at login.
If the user chooses Webmail then they input their email address and password and login. If the user chooses clients they input their username and password and login.
...
|
by: makunta |
last post by:
Hi all,
First here is the website of what I am trying to do: http://www.exmhosting.com/
Locate the login form on the top-right of the page. What I need to do is allow the user to sign into different sections of the website according to the radio button choice at login.
If the user chooses Webmail then they input their email address and password and login. If the user chooses clients they input their username and password and login.
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |