C# :: How To Show MessageBox In 2 Radio Button

Oct 21, 2014

I'm trying to do this :

when user chick first radio button a message1 will show with OK button
when user chick second radio button an another message2 will show with OK button

But its didn't work like this. its work like:

1- user chick first radio button
2- message1 will show with OK button
3- user click OK
4- user chick second radio button
5- message1 will show again with OK button
6- user click OK
7- then message2 will show again with OK button

so when user click in second time its show the 2 message the message1 then the message2

this is my code

private void radioButton2_CheckedChanged(object sender, EventArgs e) {
MessageBox.Show("Amount is ...
" + money, "Amount" , MessageBoxButtons.OK , MessageBoxIcon.Information);
}
private void radioButton1_CheckedChanged(object sender, EventArgs e) {
MessageBox.Show("Item name : " + arr[0].name ,
"Availability", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

View 3 Replies


ADVERTISEMENT

C# :: Sharepoint Radio Button Value

Oct 28, 2014

I am working on a website so you can order online for a restaurant. I currently figured out how to get values of all checkboxes and dropdownlists but i still cannot seem to figure out radio buttons.

Right now i am just making a super string with all of the selected values but eventually i am going to want to make a receipt with a checkout page.

//this seems to work alright
XPathNodeIterator toppingIterator = myNavigator.Select("//my:ToppersGroup", NamespaceManager);
s +=+ "";
while (toppingIterator.MoveNext()) {
XPathNavigator node = toppingIterator.Current;
XPathNodeIterator children = node.SelectChildren(XPathNodeType.All);
while (children.MoveNext())

[Code] .....

View 5 Replies View Related

C# :: Selected Radio Button With Database In It?

Feb 24, 2014

I am developing a project that generates questions from a database, the questions are generated with multiple choice answers. On this form I have got a textbox that reds the question from the database and 4 radio buttons that reads the possible answers from the database. The radio buttons text names are updated with records from a database table each time the "next button" is clicked.

What I want this program to do is that when the user selects one of the radio buttons, I want the system to check if the selected radio button textname equals the right answer in the database table. for example in the table there are 5 columns namely: option1, option2, option3, option4 and rightAnswer. So whenever a user selects a radio button, I would like the system to check if the selected radio button's textname equals the record in the "RightAnswer" column and if so I would a messagebox to show "correct" and if not the messgaebox to show "wrong"

This is the the way I am updating the radio button text names from the database This method is called when the form is loaded

void LoadingPossibleAnswers() {
Query = "SELECT * FROM AnswersTbl";
theReader = conn.ExecuteStatement(Query);
while (theReader.Read()) {
radioButton1.Text = theReader["Option1"].ToString();

[code]....

This method is called when the button is clicked

void CorrectAnswer( RadioButton rdb) {
string correct = rdb.Text;
Query = "SELECT * FROM FROM AnswersTbl;"
theReader = conn.ExecuteStatement(Query);
while (theReader.Read())

[code]....

When ever I run my code above, else condition executes even if the correct radio button is selected.

View 3 Replies View Related

C# :: How To Use List Box Based On Radio Button Selection

Jun 2, 2014

How to put together this assignment. Here is the assignment:

The ABC Shipping Company charges the Rates listed in the following table:

Weight of the package (in kilograms) Shipping rate per mile in California Shipping rate per mile other states

2 kg or less $2.0 $2.5

Over2 kg but not more than 6 kg $3.0 $3.5

Over 6 Kg but not more than 10 kg $3.5 $4.0

Over 10 Kg but not more than 30 Kg $4.0 $4.5

Over 30 kg $5.0 $5.5

Create an application that contains two radio buttons to select California or other states, a listbox for the user to select the package’s weight class, a textbox to enter the distance it is to be shipped, and a button to calculate and display the charges on a label control when it is clicked.

Input validation: Do not accept distances of less than 5 miles or more than 3000 miles

This is what I have so far. I don't know how to set up the listbox option for non california or how to set up a formula.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

[Code] ....

View 3 Replies View Related

Visual C++ :: Clicking On Radio Button Crashing Dialog

Mar 3, 2014

I have an existing dialog, having activex control, list control, tree control checkbox, button etc.... I added one radio button and executed the program. whenever i am clicking on the radio button, the dialog hang/crash. Even simply dragging one radio button from toolbox and executing also behaving in the same way.

View 2 Replies View Related

C Sharp :: How To Bind WPF Datagrid Radio-button Column To Entities Class

May 7, 2012

In my WPF application I created a LINQ to SQL entities class. Then I created a partial class and there add code to my entity class. Below is the code of it:

namespace Mynamespace {
    partial class rts_index {
        #region Fields  
        /// <summary>
        /// Status:
        /// "Selected" - true, "Unselected" - false.
        /// </summary>
        private bool _is_selected;

[code]....

Then I executed LINQ to SQL. Works perfectly well. Then I bound WPF Datagrid radiobutton column to is_selected property of the partial class. Below is XAML code:

.
.
.
<Window.Resources>
<CollectionViewSource x:Key="rts_indexViewSource" d:DesignSource="{d:DesignInstance my:rts_index, CreateList=True}" />
</Window.Resources>

[code]....

And here I have the problem. When I'm changing the radiobutton status from Unchecked to Checked it doesn't change the value of is_selected property from false to true in the partial class. I don't know why.

View 1 Replies View Related

C/C++ :: Winform - Button Does Not Show At Runtime

Jun 18, 2014

I made a winForm with a button on it in the Designer (VS 2010 C++).

But when I run my app, the button does not show on the form.

The button visible property is set to true.

View 8 Replies View Related

C Sharp :: Show Results From Values In Text Boxes On Clicking Or Pressing Tab Button

Feb 21, 2013

I am developing application software.entering two textbox value,while click or pressing tab button in third textbox, the result needs to show in third textbox.

View 1 Replies View Related

C# :: Why Does MessageBox Call Create A New Form

Jul 15, 2014

I have a form that has been loaded and I click on a quit link to terminate my app but then I display a messageBox to ask the user if they want to save a file before quitting. When the messageBox pops up, another new instance of this form displays. What causes this and how can I prevent it?

View 9 Replies View Related

Visual C++ :: Debug Assertion Failed With MessageBox

Mar 22, 2014

I am trying to use MessageBox in OnInitialUpdate function but its giving me "Debug Assertion Failed Message"

File: f:ddvctoolscrt_bldself_x86crtsrcvsprintf.c
Line:244

I am using the following code:

Code:
void CRotateImageView::OnInitialUpdate() {
int k;char str[2];
CView::OnInitialUpdate();
CString szStr,szstr1;

[Code] .....

However when i am using the same code in OnDraw its working.

Code:
void Csprintf_sEGView::OnDraw(CDC* /*pDC*/) {
Csprintf_sEGDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;

[Code] ....

View 3 Replies View Related

Visual C++ :: How To Change Background Color Of Messagebox

Jan 5, 2015

Here is what I did,

Code:
oldHook = ::SetWindowsHookEx(WH_CALLWNDPROCRET, CallWndRetProc, NULL, ::GetCurrentThreadId());

MessageBox(...);

UnhookWindowsHookEx(oldHook);

Then within the callback function CallWndRetProc, I tried to change the background color of the dialog,

Code:
PAINTSTRUCT ps;
HDC hdc = BeginPaint(msg->hwnd, &ps);
::SetBkColor(hdc, RGB(255, 0, 0));
EndPaint(msg->hwnd, &ps);

But it doesn't change the background color of the dialog. I wonder what is the right way to do that?

View 14 Replies View Related

C Sharp :: Loop In A Button / Runs Endless When Pressing The Button And Not Only Once

Jun 10, 2014

I have an code that makes form window + button bet bigger when pressed each time, but it runs endless till out of screen,

code:
{
int S1 = 300;
int S2 = 0;

[Code]...

make it so it runs only each time i press the button?

View 2 Replies View Related

C++ :: Radio Station - Streaming Audio On The Web

Jan 22, 2013

work for a radio station as their webmaster, and we have been looking into online streaming options for the last few months for our website. Pretty much everyone charges a monthly fee for this type of service and I feel like it is something I am capable of doing myself.

At the station we have a computer dedicated to operating the music/talk. On this computer there is a program that ques all the music, ads, ect.. This would be my audio source: Either the program playing all the music, or the computer itself.

The problem I have been pondering all night is how would I access this input source? The only audio input I am familiar with accessing is .mp3 or .wav files. How can I code my program to access this audio the program is producing and stream it to people on the web?

View 1 Replies View Related

C++ :: System For Managing Radio Station - Crashes When Tries To Dereference The Iterator

Jul 28, 2013

My assignment is to write a system for managing a radio station. The code is composed of four classes:

Song: each song has a name, a composer and a singer, and has a few segments: INTRO,VERSE,CHORUS,TRANSITION, while each represents a different length string of chars.
Playlist: a multiset of songs, and a pointer to a RadioStatistics instance (see below).
RadioStation: a set of Songs (will represent the station database), and a list of Playlists, each playlist holds a few songs from the database.
RadioStatistics: can only be instantiate once, this object gather statistics; it has two maps: one that counts how many times a song was played, and second that counts how many times each singer was played. (the key is the song/singer name, and the value is the counter).

The RadioStation has a constant that defines a limit to how many times a song is allowed to be played. whenever a song reaches this limit (meaning, it was played too much), the program needs to skip to the next song in the database.

so, I run this test from main, and the program crashes (or more accuratly get stuck, since the console stays open and the program keeps working until I stop it).

I made a few changes and run the debugger a few times, and was able to focus on the problem.

Song.h:
Code:
#ifndef SONG_H_
#define SONG_H_
#include<iostream>
#include<string>

[Code] ....

I ran a step by step debugger, and found out the problem lays with line 90 in RadioManager.cpp, when the while loop runs its fourth iteration. It crashes when it tries to dereference the iterator, while it points to the fourth playlist in the list.

And here's some more weird stuff: when I comment out line 73 in main.cpp - it works perfectly fine! (line 73 in particular! commenting out any other line in main.cpp didn't worked around the bug!)

View 13 Replies View Related

C++ :: Create A Small Radio That Allows To Retrieve Audio From URL - External Libraries?

Apr 10, 2014

I've finished my series of tutorials and built a investment calculator with QT, now that's finished and I wanted to create a small radio that allows to retrieve audio from an URL. I wanted to use Juce but I'm clueless about it, I know how to program but I've never touched external libraries?

View 2 Replies View Related

C++ :: Simulated Radio Station Holding A Contest - Guess Number / Sequential Search

Dec 14, 2014

I have an assignment to write the code for a simulated radio station holding a contest. The contest is for a "caller" (user input obviously) to guess a number from 1 to 500. The "randomly generated" numbers are already chosen and are being stored in a .txt file. The code is to search for number guessed by the caller and if they are wrong, next caller until a caller is correct. The end result is to display the winning number, the indexed location the number was found, and how many callers guessed. This is what I have...

Code:
#include<iostream>
#include<fstream>
using namespace std;
int sequenSrch(const int prizeArray[], int arrayLength, int searchedItem);
int guess();

[Code] ....

I'm not sure if I am even on the right track... when I pass something into the sequenSrh(); the code compiles, asks for the number to be guessed and ends.

View 2 Replies View Related

C++ :: Callback For A Button?

Apr 25, 2013

I have made a calendar that looks similar to Outlook, and I have the next/previous buttons, but they don't do anything when you click them. how to create the callback so that when I click next it goes to the next month?

View 4 Replies View Related

C# :: How To Add A Button To A Groupbox

Jun 25, 2014

I have a winform that I added a button to at design time.

Then I decided to add a groupbox to the form because I want to add a few more components to the gbox.

I notice if I add a gbox at design time and add components onto the gbox at design time, then the components show up when I run my app.

However, if I add a gbox after my form already has compoents on it, I can't see some of my components.

How do I move an existing button onto a new gbox so it shows?

I thought this would work but it doesn't:

gboxSettings.Controls.Add(btnChecklistFonts);

View 14 Replies View Related

C# :: How To Show A Frame Of Gif

Jan 10, 2015

I want to show a frame of a gif image. I searched and found that the following code should work, but it doesn't work. it detects the number of frames correctly but it shows the whole frames of gif instead of the specified frame.

Image[] frames = new Image[36];
Image GG = Image.FromFile(@"C:UsersAdministratorTEST C#TEST2frame2chef.gif");
FrameDimension dimension = new FrameDimension(GG.FrameDimensionsList[0]);
// Number of frames
int frameCount = GG.GetFrameCount(dimension);
label1.Text = frameCount.ToString();
// Return an Image at a certain index
GG.SelectActiveFrame(dimension, 1);
frames[1] = ((Image)GG.Clone());
pictureBox1.Image = frames[1];

View 2 Replies View Related

C/C++ :: Show All Subset Of A Sub?

Feb 6, 2014

A program is a set of all subsets of this part of the show. Users can enter a number., For example, if n = 2 the output looks like this:

{}
{1}
{2}
{1,2}
or for n=3 we have:
{}
{1}
{2}
{3}
{1,2}
{1,3}
{2,3}
{1,2,3}

meantime this program should be solved with tow way. recursive function and Non-recursive.Can also be used in solving the problem of bitwise operations.

View 2 Replies View Related

C++ :: Push Button On A Website?

Nov 25, 2013

I was wondering if it's possible to push a button on a website programatically. Unfortunately the button link is invisible, otherwise I could simply use the URL it links to. So is there a way to do it in c++ and if so, how?

View 4 Replies View Related

C++ :: Check If A Button Has Been Pressed?

Jul 7, 2014

I know how to check if a particular button has been pressed but I basically want to disable the delete button when ever the listbox has lost focus. I am having issues with the fact the button gets disabled before it receives the message. Is their a way around this that is non hacky?

BOOL CALLBACK DlgMain(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{

[Code]....

View 1 Replies View Related

C++ :: QT Make Button Unclickable?

Nov 26, 2013

I am new to qt. I want to make it so a button is only clickable if they check a radio box. otherwise it wont do anything. how would i write that?

View 3 Replies View Related

C# :: Custom Button Shape (WPF)

Nov 30, 2014

I have begun switching from WinForms to WPF and I'm having a hard time understanding the new concepts. In WinForms, I had a few User Controls, custom drawn using shapes (rectangles, ellipses, etc). They had some unique properties, like "Flashing" (setting this property to True and setting the "Flash Interval" property to 500 would have resulted in the control changing its background color to white and back again, every 0.5 seconds), "Beeping", etc.

I have tried to replicate these controls in WPF/XAML and so far managed to draw the shape. However, when it came to implementing a custom property that would redraw the background color of the rectangle every interval set by user in another property, i got stuck. The property is being set, but it doesn't change the background color. Alternatively, i have tried this method, with the same results (i got it to show in the "Properties" window in Visual Studio, i can set it, it is being stored in XAML, but it doesn't affect the background.

C# code behind:
public struct LCARSColors
{
public static Brush DarkBlue = (Brush)(new BrushConverter().ConvertFrom("#FF3366CC"));
public static Brush LightBlue = (Brush)(new BrushConverter().ConvertFrom("#FF99CCFF"));
public static Brush Pink = (Brush)(new BrushConverter().ConvertFrom("#FFCC99CC"));

[Code] ....

If i use this line (commented in this code sample):

<!--<SolidColorBrush x:Name="MySolidColorBrush" Color="{DynamicResource DarkBlue}" />-->

The background is colored in DarkBlue (as defined). But if i use this line:

<SolidColorBrush x:Name="MySolidColorBrush" Color="{Binding BackgroundColor, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />

Nothing happens, the rectangle disappears entirely. If i add this to the above line:

FallbackValue=LightYellow

The rectangle is colored in LightYellow, meaning that the property is not accepted and the fallback value is used. Why?

View 9 Replies View Related

C# :: Button Taking To Another Page

Nov 12, 2014

I decided to code my own GUI menu. getting to another page from a button click. I have added the event handler I think (click="Button_click") then in the event handler I have added this:

private void Button_Click(object sender, System.EventArgs e);
}
Response.Redirect("Login.xaml");
}

After researching it says either to use
Response.Redirect("Login.xaml");
OR
Server.Transfer("Login.xaml");
Neither of these work, underlining "Response" and "Server" as an error saying "A namespace cannot directly contain members such as fields or methods."

NOTE: MY MAIN GUI PAGE IS CALLED "mainpage.xaml" THE CODE ABOVE IS STORED IN THE "mainpage.xaml.cs" THIS MIGHT BE RIGHT OR WRONG BUT I'M NOT SURE SO I AM LEAVING SOME EXTRA INFO!

View 1 Replies View Related

C# :: Make A Button Transparent?

Apr 22, 2014

How can I make a button transparent? I know i can select color Transparent, but that takes the background color, and i want to be transparent all because i have a video behind it. What can i do? :o3

I have a video and there is some buttons which should be pressed. I could insert the buttons but they are semi-transparent...

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved