Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
GeneralRe: Looking for a good book on C# Pin
Braulio Dez9-Sep-03 23:28
Braulio Dez9-Sep-03 23:28 
GeneralC# Suitable for my new app? please help! Pin
Hydra9-Sep-03 7:53
Hydra9-Sep-03 7:53 
GeneralRe: C# Suitable for my new app? please help! Pin
Mazdak9-Sep-03 9:10
Mazdak9-Sep-03 9:10 
GeneralRe: C# Suitable for my new app? please help! Pin
J. Dunlap9-Sep-03 9:49
J. Dunlap9-Sep-03 9:49 
GeneralRe: C# Suitable for my new app? please help! Pin
monrobot139-Sep-03 13:16
monrobot139-Sep-03 13:16 
GeneralRe: C# Suitable for my new app? please help! Pin
Hydra9-Sep-03 22:15
Hydra9-Sep-03 22:15 
GeneralRunning Windows App over network Pin
Anonymous9-Sep-03 7:01
Anonymous9-Sep-03 7:01 
GeneralRe: Running Windows App over network Pin
joan_fl9-Sep-03 10:28
joan_fl9-Sep-03 10:28 
GeneralRe: Running Windows App over network Pin
Tatham10-Sep-03 6:54
Tatham10-Sep-03 6:54 
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 

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.