|
-
October 23rd, 2009, 02:12 AM
#16
Re: Radiobutton creation
my aim is to select a radiobutton and then push a pushbutton. that pushbutton will retrieve the selected radiobutton's text..
-
October 23rd, 2009, 02:33 AM
#17
Re: Radiobutton creation
Are you having trouble with knowing when you pressed the push button?
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
October 23rd, 2009, 02:35 AM
#18
Re: Radiobutton creation
see.. i want to select a radiobutton and retrieve that radio's name by a messagebox by pressing a pushbutton..
-
October 23rd, 2009, 02:38 AM
#19
Re: Radiobutton creation
 Originally Posted by hypheni
...
Code:
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case ID_RADIO1:
if ( HIWORD(wParam) == BN_CLICKED)
{
WCHAR text[100];
SendMessage((HWND)hRadio, WM_GETTEXT, 100, (LPARAM)text);
MessageBox(0,text,0,0);
}
break;
}
}
What does this "undefined" hRadio mean?
Victor Nijegorodov
-
October 23rd, 2009, 02:40 AM
#20
Re: Radiobutton creation
So I suppose that means yes? It is the same for any type of button
Code:
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case ID_PUSHBUTTON:
if ( HIWORD(wParam) == BN_CLICKED)
{
WCHAR text[100];
SendMessage((HWND)hRadio, WM_GETTEXT, 100, (LPARAM)text);
MessageBox(0,text,0,0);
}
break;
}
}
is that what you wanted?
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
October 23rd, 2009, 02:43 AM
#21
Re: Radiobutton creation
 Originally Posted by hypheni
see.. i want to select a radiobutton and retrieve that radio's name by a messagebox by pressing a pushbutton..
- Which "radiobutton" from these ten do you want to "select?"
- How do you want to "select": using CheckRadioButton API or...?
 - Please, don't post code with undefined identificators
Victor Nijegorodov
-
October 23rd, 2009, 02:49 AM
#22
Re: Radiobutton creation
@..Victor N.
HWND hRadio[10] is declared globally... and SendMessage() can not cast to HWND to HWND_ thats wht (HWND)hRadio.
@..Joeman
Ya this I need.. But in..
SendMessage((HWND)hRadio, WM_GETTEXT, 100, (LPARAM)text);
hRadio index should be mentioned.. here is the problem. selected radiobutton's index should be mentioned here..
Last edited by hypheni; October 23rd, 2009 at 02:52 AM.
-
October 23rd, 2009, 03:02 AM
#23
Re: Radiobutton creation
I suppose you can loop through each radio button and check to see which is checked with IsDlgButtonChecked or SendMessage.. for ex
Code:
//loop code
LRESULT lResult = SendMessage( hRadio[i], BM_GETCHECK, 0, 0 );
bool Checked = lResult == BST_CHECKED;
if( Checked ) RadioId = i;
//end of loop code
now you have the Id in RadioId
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
October 23rd, 2009, 03:04 AM
#24
Re: Radiobutton creation
@..VictorN
i have checked radiobutton 1.. by putting
CheckRadioButton(hReIP, ID_RADIO1, ID_RADIO10, ID_RADIO1);
in WM_INITDIALOG.
-
October 23rd, 2009, 03:14 AM
#25
Re: Radiobutton creation
@..Joeman
I think this code is going to be useful for me. Let me implement it a bit more.. Thanks..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|