Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
Questionwhat's the difference between Byte and byte? Pin
SHenin9-Sep-03 5:45
SHenin9-Sep-03 5:45 
AnswerRe: what's the difference between Byte and byte? Pin
Alvaro Mendez9-Sep-03 6:24
Alvaro Mendez9-Sep-03 6:24 
AnswerRe: what's the difference between Byte and byte? Pin
leppie9-Sep-03 7:06
leppie9-Sep-03 7:06 
GeneralRe: what's the difference between Byte and byte? Pin
David Stone9-Sep-03 8:09
sitebuilderDavid Stone9-Sep-03 8:09 
GeneralWindowsControl Background Pin
Mazdak9-Sep-03 5:14
Mazdak9-Sep-03 5:14 
GeneralRe: WindowsControl Background Pin
sumeat9-Sep-03 10:14
sumeat9-Sep-03 10:14 
GeneralRe: WindowsControl Background Pin
Mazdak9-Sep-03 21:53
Mazdak9-Sep-03 21:53 
QuestionUsing postmessage to interoperate? Pin
mcgahanfl9-Sep-03 5:02
mcgahanfl9-Sep-03 5:02 
What I would really like to do is tell the parent control to send a button click to a child control. In C++ it would be this

pParent->SendMessage( WM_COMMAND, MAKEWPARAM(ID_Of_CHILD, BN_CLICKED) );

Can you help me with this syntax or point me towards reading material? Below is my best effort. Thanks.

using System.Runtime.InteropServices;
public class Form1 : System.Windows.Forms.Form
{
[DllImport("user32.dll")]
protected static extern int PostMessage(
IntPtr wnd,
uint Msg,
IntPtr wParam,
IntPtr lParam);
.
.
.


private void button1_Click(object sender, System.EventArgs e)
{
*
#define BN_CLICKED 0
#define BN_PAINT 1
#define BN_HILITE 2
#define BN_UNHILITE 3
#define BN_DISABLE 4
#define BN_DOUBLECLICKED 5
*/

const uint WM_COMMAND = 0x0111;
const uint BN_CLICKED = 0x0000;
PostMessage((IntPtr)BusinessRules.Handle, WM_COMMAND, (IntPtr)BN_CLICKED, (IntPtr)IntPtr.Zero);

}


private void BusinessRules_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.MessageBox.Show("I was clicked");
}
AnswerRe: Using postmessage to interoperate? Pin
Julian Bucknall [MSFT]9-Sep-03 6:30
Julian Bucknall [MSFT]9-Sep-03 6:30 
GeneralRe: Using postmessage to interoperate? Pin
mcgahanfl9-Sep-03 6:58
mcgahanfl9-Sep-03 6:58 
QuestionSetting focus on a control? Pin
mcgahanfl9-Sep-03 3:51
mcgahanfl9-Sep-03 3:51 
AnswerRe: Setting focus on a control? Pin
MeisterBiber9-Sep-03 4:12
MeisterBiber9-Sep-03 4:12 
GeneralRe: Setting focus on a control? Pin
mcgahanfl9-Sep-03 4:55
mcgahanfl9-Sep-03 4:55 
GeneralRe: Setting focus on a control? Pin
Mazdak9-Sep-03 5:16
Mazdak9-Sep-03 5:16 
GeneralRe: Setting focus on a control? Pin
MeisterBiber9-Sep-03 5:41
MeisterBiber9-Sep-03 5:41 
GeneralRe: Setting focus on a control? Pin
Mazdak9-Sep-03 6:02
Mazdak9-Sep-03 6:02 
Generalhelp Pin
cheeseruler9-Sep-03 3:19
cheeseruler9-Sep-03 3:19 
GeneralRe: help Pin
David Stone9-Sep-03 4:36
sitebuilderDavid Stone9-Sep-03 4:36 
GeneralRe: help Pin
joan_fl9-Sep-03 10:29
joan_fl9-Sep-03 10:29 
GeneralRe: help Pin
cheeseruler10-Sep-03 2:54
cheeseruler10-Sep-03 2:54 
Generalforce datagrid to display "ahead-0" of integer Pin
MeisterBiber9-Sep-03 3:18
MeisterBiber9-Sep-03 3:18 
GeneralRe: force datagrid to display "ahead-0" of integer Pin
Jim Stewart9-Sep-03 3:20
Jim Stewart9-Sep-03 3:20 
GeneralFrames in axWebBrowser control Pin
Andrlage9-Sep-03 1:52
Andrlage9-Sep-03 1:52 
GeneralRe: Frames in axWebBrowser control Pin
Jagadeesh VN9-Sep-03 3:38
Jagadeesh VN9-Sep-03 3:38 
GeneralRe: Frames in axWebBrowser control Pin
Andrlage9-Sep-03 11:54
Andrlage9-Sep-03 11:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.