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

C#

 
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 
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 
I would like to set focus on the 1st control that does not have data.
For most controls I can ask in the text field is empty. But for checkboxes and radio buttons, I must ask for the special case of 'GetChecked'. If it was only these two types of controls the code below would be OK. But controls derived from Checkbox and Radio button would also need special case code.

How can I ask if a control is a checkbox or derived from a check box?

public void SetFocusOnFirstEmptyControl()
{
int iCount=0;
System.Windows.Forms.Control Traverse = this;
//System.Reflection
while(Traverse != null)
{
Debug.WriteLine(++iCount + " " + Traverse.Text );
if(Traverse.GetType() == typeof(System.Windows.Forms.CheckBox))
{//do special case handling for check box
System.Windows.Forms.CheckBox pCheck = Traverse;
if(pCheck.Checked()== false)
{
Traverse.Focus();
break;
}
}
if(Traverse.Text.Length == 0)
{//test controls like textbox and dropdown
Traverse.Focus();
break;
}
Traverse = GetNextControl(Traverse, true);

}//while

Roll eyes | :rolleyes:
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 
GeneralRe: Frames in axWebBrowser control Pin
Arun Chembilath30-Apr-11 7:10
Arun Chembilath30-Apr-11 7:10 
GeneralDLL import and parameters Pin
gmar9-Sep-03 0:56
gmar9-Sep-03 0:56 
GeneralRe: DLL import and parameters Pin
Jagadeesh VN9-Sep-03 3:49
Jagadeesh VN9-Sep-03 3:49 

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.