[nsbasic-ce] ActiveSync Conduit Shutdown ...
Has anyone had the experience of having the ActiveSync conduit close at the termination of an NSBasic program? This happens no matter how I terminate the program. I've used Bye, ShowOkButton and terminating the program from Windows. It doesn't seem to crash ActiveSync. It will start up again if I remove and replace the device in the cradle. (This probably isn't good for the connector.) Its Vista (sadly) so it's Windows Mobile Device Center. Its WM5 on a Dell Axim. ActiveSync on the device terminates so the PC thinks the device is removed. Or at least that's how it behaves. Remove the device from the cradle and return it. ActiveSync starts up again and the PC connects normally. This isn't a problem in the field ... but during development ... it's annoying. At your service ... Randall Jones randalljo...@comcast.net AE7RJ "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein (1879-1955) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to nsb-ce@googlegroups.com To unsubscribe from this group, send email to nsb-ce+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~--~~~~--~~--~--~---
[nsbasic-ce] Make EXEs ...
NSBasic v7 will make EXEs, but those program won't run on a Windows device that doesn't have the runtime installed. Am I doing something wrong? At your service ... Randall Jones randalljo...@comcast.net AE7RJ "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein (1879-1955) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to nsb-ce@googlegroups.com To unsubscribe from this group, send email to nsb-ce+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~--~~~~--~~--~--~---
[nsbasic-ce] Radio Buttons ...
I'm beginning to take this personal. I am trying to create grouped optionbuttons. The language reference says it goes like this. - Create the first button. Set the group property to true. - Create the subsequent buttons group property to false. They will all be in the same group. Idea being that within that group only 1 button can be set at a time. Clicking on a button will clear any button already set. This is not happening for me. I can set all buttons no matter what. I'm doing something wrong. Somebody please tell me what it is. At your service ... Randall Jones randalljo...@comcast.net AE7RJ "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein (1879-1955) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to nsb-ce@googlegroups.com To unsubscribe from this group, send email to nsb-ce+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~--~~~~--~~--~--~---
[nsbasic-ce] Re: Radio Buttons ...
--- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > I'm beginning to take this personal. > > I am trying to create grouped optionbuttons. The language reference > says it goes like this. > > - Create the first button. Set the group property to true. > - Create the subsequent buttons group property to false. > > They will all be in the same group. Idea being that within that group > only 1 button can be set at a time. Clicking on a button will clear > any button already set. > > This is not happening for me. I can set all buttons no matter what. > > I'm doing something wrong. Somebody please tell me what it is. > > At your service ... > > Randall Jones > randalljo...@... > AE7RJ > > "We can't solve problems by using the same kind of thinking we used > when we created them." > --Albert Einstein (1879-1955) > Don't you just love programming with less than stellar examples ... especially when you are just learning as I am as well.. I am developing for a CuWin3500 HMI device, having CE 5.0 in it. I posed a similar question a few weeks ago, and did not get any replys. I have the same issue, with Radio or Option Buttons. What I found was that I had to do the following Option Explicit Dim HoleType Sub OB1_Click HoleType="Mechanical" OB1.ForeColor = &H00C0& OB1.Value = True OB2.Value = False OB2.ForeColor =&H& OB3.Value = False OB3.ForeColor =&H& OB4.Value = False OB4.ForeColor =&H& End Sub Sub OB2_Click HoleType="Hand Hole" OB2.ForeColor =&H00C0& OB2.Value = True OB1.Value = False OB1.ForeColor =&H& OB3.Value = False OB3.ForeColor =&H& OB4.Value = False OB4.ForeColor =&H& End Sub etc for each radio button In essence, make one button's Value TRUE, and all the rest False In my case I also wanted to change the color of the Text of the button to show that it was picked. The problems I found were that the radio button, the Solid Dot and the circle around it, did not increase in size as my text font, or size of the total button increased in size, and you have to pick the Dot/Circle to activate the button, not the body of the text. For 39 radio buttons, I ended up with 1289 lines of Code, for 4 forms of buttons. My second approach was to use the following: Option Explicit ShowOKButton True 'Set minimize button URHC to close app ' make full screen hide taskbar and top menu Dim hWnd Dim nWidth Dim nHeight Dim bRepaint Declare "Function GetForegroundWindow Lib ""Coredll"" () As Long" Declare "Function MoveWindow Lib ""Coredll"" (ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long" hWnd = GetForegroundWindow ' MoveWindow hWnd, 0, -26, Output.Width, Output.Height + 78, True ' was 52, 26 try real height at 480 add 26 for 506 MoveWindow hWnd, 0, -26, Output.Width, 506, True '' need To hide the taskbar On Cuwin using a mouse in the USB port Form1_Show Dim DrlB(40) Dim DrlR(40) Dim BarC(10) Dim HoleT(10) Dim NHole(15) Dim ChrgS(30) Dim Pic(40) Dim X, Y, I, J, K, L, M Dim picName Dim Frm Dim DrillDepth Dim strDepth Dim DrlRH Dim PathSD PathSD = "\Storage Card\Drill Depth Buttons\" DrlB(1) = "0_50B.bmp" DrlR(1) = "0_50R.bmp" DrlB(2) = "1_00B.bmp" ' the rest of the DrlB(3) = "1_50B.bmp" list Frm = 0 For I = 1 To 10 If I <= 4 Then X = 20 Y = 75 + (( I-1)*100) End If If (I > 4) And (I <=8) Then X = 250 Y = 75 + (( I-5)*100) End If If (I > 8) And (I <=10) Then X = 480 Y = 75 + (( I-9)*100) End If picName = "pic" & CStr(I) AddObject "NSCEPictureBox.NSCEPictureBoxCtrl.1",picName,X,Y,220,90 Execute picName & ".ScaleMode = 3" ' pixels Execute picName & ".BorderStyle = 0" ' none Execute picName & ".Picture = PathSD & DrlB(I)" Next Sub pic1_Click DrillDepth = Frm + 1 pic1.Picture = PathSD & DrlR(Frm + 1) pic2.Picture = PathSD & DrlB(Frm + 2) pic3.Picture = PathSD & DrlB(Frm + 3) pic4.Picture = PathSD & DrlB(Frm + 4) pic5.Picture = PathSD & DrlB(Frm + 5) pic6.Picture = PathSD & DrlB(Frm + 6) pic7.Picture = PathSD & DrlB(Frm + 7) pic8.Picture = PathSD & DrlB(Frm + 8) pic9.Picture = PathSD & DrlB(Frm + 9) pic10.Picture = PathSD & DrlB(Frm + 10) strDepth = FormatNumber(DrillDepth/2, 2, True) TextBox_1.Text = "You have Picked a Drill Depth of " TextBox_2.Text = strDepth & " Meters" End Sub Sub pic2_Click DrillDepth = Frm + 2 pic1.Picture = PathSD & DrlB(Frm + 1) pic2.Picture = PathSD & DrlR(Frm + 2) pic3.Picture = PathSD & DrlB(Frm + 3) pic4.Picture = PathSD & DrlB(Frm + 4) pic5.Picture = PathSD & DrlB(Frm + 5) pic6.Picture = PathSD & DrlB(Frm + 6) pic7.Picture = PathSD & DrlB(Frm + 7) pic8.Picture = PathSD & DrlB(Frm + 8) pic9.Picture = PathSD & DrlB(Frm + 9) pic10.Picture = PathSD & DrlB(Frm + 10) strDepth = FormatNumber(DrillDepth/2, 1, True) TextBox_1.Text = "You have Pick
[nsbasic-ce] Re: Radio Buttons ...
--- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > I'm beginning to take this personal. > > I am trying to create grouped optionbuttons. The language reference > says it goes like this. > > - Create the first button. Set the group property to true. > - Create the subsequent buttons group property to false. > > They will all be in the same group. Idea being that within that group > only 1 button can be set at a time. Clicking on a button will clear > any button already set. > > This is not happening for me. I can set all buttons no matter what. > > I'm doing something wrong. Somebody please tell me what it is. > > At your service ... > > Randall Jones > randalljo...@... > AE7RJ > > "We can't solve problems by using the same kind of thinking we used > when we created them." > --Albert Einstein (1879-1955) > Don't you just love programming with less than stellar examples ... especially when you are just learning as I am as well.. I am developing for a CuWin3500 HMI device, having CE 5.0 in it. I posed a similar question a few weeks ago, and did not get any replys. I have the same issue, with Radio or Option Buttons. What I found was that I had to do the following Option Explicit Dim HoleType Sub OB1_Click HoleType="Mechanical" OB1.ForeColor = &H00C0& OB1.Value = True OB2.Value = False OB2.ForeColor =&H& OB3.Value = False OB3.ForeColor =&H& OB4.Value = False OB4.ForeColor =&H& End Sub Sub OB2_Click HoleType="Hand Hole" OB2.ForeColor =&H00C0& OB2.Value = True OB1.Value = False OB1.ForeColor =&H& OB3.Value = False OB3.ForeColor =&H& OB4.Value = False OB4.ForeColor =&H& End Sub etc for each radio button In essence, make one button's Value TRUE, and all the rest False In my case I also wanted to change the color of the Text of the button to show that it was picked. The problems I found were that the radio button, the Solid Dot and the circle around it, did not increase in size as my text font, or size of the total button increased in size, and you have to pick the Dot/Circle to activate the button, not the body of the text. For 39 radio buttons, I ended up with 1289 lines of Code, for 4 forms of buttons. My second approach was to use the following: Option Explicit ShowOKButton True 'Set minimize button URHC to close app ' make full screen hide taskbar and top menu Dim hWnd Dim nWidth Dim nHeight Dim bRepaint Declare "Function GetForegroundWindow Lib ""Coredll"" () As Long" Declare "Function MoveWindow Lib ""Coredll"" (ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long" hWnd = GetForegroundWindow ' MoveWindow hWnd, 0, -26, Output.Width, Output.Height + 78, True ' was 52, 26 try real height at 480 add 26 for 506 MoveWindow hWnd, 0, -26, Output.Width, 506, True '' need To hide the taskbar On Cuwin using a mouse in the USB port Form1_Show Dim DrlB(40) Dim DrlR(40) Dim BarC(10) Dim HoleT(10) Dim NHole(15) Dim ChrgS(30) Dim Pic(40) Dim X, Y, I, J, K, L, M Dim picName Dim Frm Dim DrillDepth Dim strDepth Dim DrlRH Dim PathSD PathSD = "\Storage Card\Drill Depth Buttons\" DrlB(1) = "0_50B.bmp" DrlR(1) = "0_50R.bmp" DrlB(2) = "1_00B.bmp" ' the rest of the DrlB(3) = "1_50B.bmp" list Frm = 0 For I = 1 To 10 If I <= 4 Then X = 20 Y = 75 + (( I-1)*100) End If If (I > 4) And (I <=8) Then X = 250 Y = 75 + (( I-5)*100) End If If (I > 8) And (I <=10) Then X = 480 Y = 75 + (( I-9)*100) End If picName = "pic" & CStr(I) AddObject "NSCEPictureBox.NSCEPictureBoxCtrl.1",picName,X,Y,220,90 Execute picName & ".ScaleMode = 3" ' pixels Execute picName & ".BorderStyle = 0" ' none Execute picName & ".Picture = PathSD & DrlB(I)" Next Sub pic1_Click DrillDepth = Frm + 1 pic1.Picture = PathSD & DrlR(Frm + 1) pic2.Picture = PathSD & DrlB(Frm + 2) pic3.Picture = PathSD & DrlB(Frm + 3) pic4.Picture = PathSD & DrlB(Frm + 4) pic5.Picture = PathSD & DrlB(Frm + 5) pic6.Picture = PathSD & DrlB(Frm + 6) pic7.Picture = PathSD & DrlB(Frm + 7) pic8.Picture = PathSD & DrlB(Frm + 8) pic9.Picture = PathSD & DrlB(Frm + 9) pic10.Picture = PathSD & DrlB(Frm + 10) strDepth = FormatNumber(DrillDepth/2, 2, True) TextBox_1.Text = "You have Picked a Drill Depth of " TextBox_2.Text = strDepth & " Meters" End Sub Sub pic2_Click DrillDepth = Frm + 2 pic1.Picture = PathSD & DrlB(Frm + 1) pic2.Picture = PathSD & DrlR(Frm + 2) pic3.Picture = PathSD & DrlB(Frm + 3) pic4.Picture = PathSD & DrlB(Frm + 4) pic5.Picture = PathSD & DrlB(Frm + 5) pic6.Picture = PathSD & DrlB(Frm + 6) pic7.Picture = PathSD & DrlB(Frm + 7) pic8.Picture = PathSD & DrlB(Frm + 8) pic9.Picture = PathSD & DrlB(Frm + 9) pic10.Picture = PathSD & DrlB(Frm + 10) strDepth = FormatNumber(DrillDepth/2, 1, True) TextBox_1.Text = "You have Pick
[nsbasic-ce] Re: Radio Buttons ...
Hi, I just tried the Option button's by adding 2 buttons to a form and setting the 2nd one Group=False. Below is the generated code. It works for me - that is selecting a option button forces the other button to unselect. Cut and paste this code into a TEXT file and load it up in the editor and run it. See if it works. '*** Begin Generated Code *** Form1_Show 'Default Form Dim Form1_Temp Sub Form1_Show On Error Resume Next UpdateScreen If IsEmpty(Form1_Temp) Then AddObject "Frame", "Form1_Form", 0, 0, Output.Width, Output.Height Form1_Form.Visible = False Form1_Form.BackColor = 12632256 AddObject "PictureBox", "Form1", 0, 0, 0, 0, Form1_Form Form1.BorderStyle = 0 Form1.Move 0, 0, Form1_Form.Width * 15, Form1_Form.Height * 15 Set Form1_Temp = Form1 Form1_Form.Caption = "Form1" AddObject "OptionButton", "OptionButton1", 27, 33, 92, 21, Form1_Form OptionButton1.BackColor = 12632256 OptionButton1.Caption = "OptionButton1" OptionButton1.FontSize = 8.25 ' AddObject "OptionButton", "OptionButton2", 32, 89, 92, 21, Form1_Form OptionButton2.BackColor = 12632256 OptionButton2.Caption = "OptionButton2" OptionButton2.FontSize = 8.25 OptionButton2.Group = False ' End If On Error Goto 0 Form1_Form.Visible = True callIfExists("Form1_Load") End Sub 'Form1_Show Sub Form1_Hide If IsEmpty(Form1_Temp) Then Err.Raise 44000, , "Form not loaded" Exit Sub End If Form1_Form.Visible = False callIfExists("Form1_Unload") End Sub 'Form1_Hide Sub CallIfExists(theSub) Dim s If ScriptEngineMajorVersion < 5 Then Execute("On Error Resume Next:"&theSub) 'attempt to execute it Else On Error Resume Next Set s = GetRef(theSub) If err.Number <> 0 Then Exit Sub 'it does not exist On Error GoTo 0 Execute (theSub) 'execute it End If End Sub '*** End Generated Code *** --- In nsbasic...@yahoogroups.com, "bwolodko" wrote: > > --- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > > > I'm beginning to take this personal. > > > > I am trying to create grouped optionbuttons. The language reference > > says it goes like this. > > > > - Create the first button. Set the group property to true. > > - Create the subsequent buttons group property to false. > > > > They will all be in the same group. Idea being that within that group > > only 1 button can be set at a time. Clicking on a button will clear > > any button already set. > > > > This is not happening for me. I can set all buttons no matter what. > > > > I'm doing something wrong. Somebody please tell me what it is. > > > > At your service ... > > > > Randall Jones > > randalljones@ > > AE7RJ > > > > "We can't solve problems by using the same kind of thinking we used > > when we created them." > > --Albert Einstein (1879-1955) > > > Don't you just love programming with less than stellar examples ... > especially when you are just learning as I am as well.. > > I am developing for a CuWin3500 HMI device, having CE 5.0 in it. > > I posed a similar question a few weeks ago, and did not get any replys. > > I have the same issue, with Radio or Option Buttons. > > What I found was that I had to do the following > > Option Explicit > Dim HoleType > > Sub OB1_Click > HoleType="Mechanical" > OB1.ForeColor = &H00C0& > OB1.Value = True > OB2.Value = False > OB2.ForeColor =&H& > OB3.Value = False > OB3.ForeColor =&H& > OB4.Value = False > OB4.ForeColor =&H& > End Sub > > Sub OB2_Click > HoleType="Hand Hole" > OB2.ForeColor =&H00C0& > OB2.Value = True > OB1.Value = False > OB1.ForeColor =&H& > OB3.Value = False > OB3.ForeColor =&H& > OB4.Value = False > OB4.ForeColor =&H& > End Sub > > etc for each radio button > > In essence, make one button's Value TRUE, and all the rest False > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to nsb-ce@googlegroups.com To unsubscribe from this group, send email to nsb-ce+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~--~~~~--~~--~--~---
Re: [nsbasic-ce] Re: Radio Buttons ...
bwolodko, That's what I'm doing now ... at OB1_Click I'm clearing all the other OptionButtons. It gets the job done. In another program I'm using a different property as the "This is the input field" flag. There are work arounds. Thanks for your input. Good luck on your program. At your service ... Randall Jones AE7RJ > --- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > > > I'm beginning to take this personal. > > > > I am trying to create grouped optionbuttons. The language reference > > says it goes like this. > > > > - Create the first button. Set the group property to true. > > - Create the subsequent buttons group property to false. > > > > They will all be in the same group. Idea being that within that group > > only 1 button can be set at a time. Clicking on a button will clear > > any button already set. > > > > This is not happening for me. I can set all buttons no matter what. > > > > I'm doing something wrong. Somebody please tell me what it is. > > > > At your service ... > > > > Randall Jones > > randalljo...@... > > AE7RJ > > > > "We can't solve problems by using the same kind of thinking we used > > when we created them." > > --Albert Einstein (1879-1955) > > > Don't you just love programming with less than stellar examples ... > especially when you are just learning as I am as well.. > > I am developing for a CuWin3500 HMI device, having CE 5.0 in it. > > I posed a similar question a few weeks ago, and did not get any replys. > > I have the same issue, with Radio or Option Buttons. > > What I found was that I had to do the following > > Option Explicit > Dim HoleType > > Sub OB1_Click > HoleType="Mechanical" > OB1.ForeColor = &H00C0& > OB1.Value = True > OB2.Value = False > OB2.ForeColor =&H& > OB3.Value = False > OB3.ForeColor =&H& > OB4.Value = False > OB4.ForeColor =&H& > End Sub > > Sub OB2_Click > HoleType="Hand Hole" > OB2.ForeColor =&H00C0& > OB2.Value = True > OB1.Value = False > OB1.ForeColor =&H& > OB3.Value = False > OB3.ForeColor =&H& > OB4.Value = False > OB4.ForeColor =&H& > End Sub > > etc for each radio button > > In essence, make one button's Value TRUE, and all the rest False > > In my case I also wanted to change the color of the Text of the button to > show that it was picked. > > The problems I found were that the radio button, the Solid Dot and the circle > around it, did not increase in size as my text font, or size of the total > button increased in size, and you have to pick the Dot/Circle to activate the > button, not the body of the text. > > For 39 radio buttons, I ended up with 1289 lines of Code, for 4 forms of > buttons. > > My second approach was to use the following: > Option Explicit > ShowOKButton True 'Set minimize button URHC to close app > > > ' make full screen hide taskbar and top menu > Dim hWnd > Dim nWidth > Dim nHeight > Dim bRepaint > Declare "Function GetForegroundWindow Lib ""Coredll"" () As Long" > Declare "Function MoveWindow Lib ""Coredll"" (ByVal hWnd As Long, ByVal x As > Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal > bRepaint As Long) As Long" > hWnd = GetForegroundWindow > ' MoveWindow hWnd, 0, -26, Output.Width, Output.Height + 78, True ' was 52, > 26 try real height at 480 add 26 for 506 > MoveWindow hWnd, 0, -26, Output.Width, 506, True > '' need To hide the taskbar On Cuwin using a mouse in the USB port > > Form1_Show > > Dim DrlB(40) > Dim DrlR(40) > Dim BarC(10) > Dim HoleT(10) > Dim NHole(15) > Dim ChrgS(30) > Dim Pic(40) > Dim X, Y, I, J, K, L, M > Dim picName > Dim Frm > Dim DrillDepth > Dim strDepth > Dim DrlRH > Dim PathSD > > PathSD = "\Storage Card\Drill Depth Buttons\" > > DrlB(1) = "0_50B.bmp" > DrlR(1) = "0_50R.bmp" > DrlB(2) = "1_00B.bmp" > > ' the rest of the DrlB(3) = "1_50B.bmp" list > > Frm = 0 > > For I = 1 To 10 >If I <= 4 Then >X = 20 >Y = 75 + (( I-1)*100) >End If >If (I > 4) And (I <=8) Then >X = 250 >Y = 75 + (( I-5)*100) >End If >If (I > 8) And (I <=10) Then >X = 480 >Y = 75 + (( I-9)*100) >End If >picName = "pic" & CStr(I) > > > AddObject "NSCEPictureBox.NSCEPictureBoxCtrl.1",picName,X,Y,220,90 > Execute picName & ".ScaleMode = 3" ' pixels > Execute picName & ".BorderStyle = 0" ' none > Execute picName & ".Picture = PathSD & DrlB(I)" > > Next > > Sub pic1_Click > DrillDepth = Frm + 1 > pic1.Picture = PathSD & DrlR(Frm + 1) > pic2.Picture = PathSD & DrlB(Frm + 2) > pic3.Picture = PathSD & DrlB(Frm + 3) > pic4.Picture = PathSD & DrlB(Frm + 4) > pic5.Picture = PathSD & DrlB(Frm + 5) > pic6.Picture = PathSD & DrlB(Frm + 6) > pic7.Picture = PathSD & DrlB(Frm + 7) > pic8.Picture = PathSD & DrlB(Frm + 8) > pic9.Picture = PathSD & DrlB(Frm + 9) > pic10.Picture = PathSD & DrlB(Frm + 10) > strDepth = FormatNumber(DrillDept
Re: [nsbasic-ce] Re: Radio Buttons ...
joespan123, I can't get the grouping to work using any method ... even AddObject instead of the IDE. However ... the same code executed on a WM2003 device works just fine. I find that quite interesting. At your service ... Randall Jones AE7RJ > Hi, > > I just tried the Option button's by adding 2 buttons to a form and setting > the 2nd one Group=False. Below is the generated code. > > It works for me - that is selecting a option button forces the other button > to unselect. > > Cut and paste this code into a TEXT file and load it up in the editor and run > it. See if it works. > > > > '*** Begin Generated Code *** > > > Form1_Show 'Default Form > > Dim Form1_Temp > Sub Form1_Show >On Error Resume Next > >UpdateScreen > >If IsEmpty(Form1_Temp) Then > AddObject "Frame", "Form1_Form", 0, 0, Output.Width, Output.Height > Form1_Form.Visible = False > Form1_Form.BackColor = 12632256 > AddObject "PictureBox", "Form1", 0, 0, 0, 0, Form1_Form > Form1.BorderStyle = 0 > Form1.Move 0, 0, Form1_Form.Width * 15, Form1_Form.Height * 15 > Set Form1_Temp = Form1 > Form1_Form.Caption = "Form1" > > AddObject "OptionButton", "OptionButton1", 27, 33, 92, 21, Form1_Form > OptionButton1.BackColor = 12632256 > OptionButton1.Caption = "OptionButton1" > OptionButton1.FontSize = 8.25 > ' > AddObject "OptionButton", "OptionButton2", 32, 89, 92, 21, Form1_Form > OptionButton2.BackColor = 12632256 > OptionButton2.Caption = "OptionButton2" > OptionButton2.FontSize = 8.25 > OptionButton2.Group = False > ' >End If >On Error Goto 0 >Form1_Form.Visible = True >callIfExists("Form1_Load") > End Sub 'Form1_Show > > Sub Form1_Hide >If IsEmpty(Form1_Temp) Then > Err.Raise 44000, , "Form not loaded" > Exit Sub >End If > >Form1_Form.Visible = False >callIfExists("Form1_Unload") > End Sub 'Form1_Hide > > Sub CallIfExists(theSub) > Dim s >If ScriptEngineMajorVersion < 5 Then > Execute("On Error Resume Next:"&theSub) 'attempt to execute it >Else > On Error Resume Next > Set s = GetRef(theSub) > If err.Number <> 0 Then Exit Sub 'it does not exist > On Error GoTo 0 > Execute (theSub) 'execute it >End If > End Sub > > '*** End Generated Code *** > > > > > --- In nsbasic...@yahoogroups.com, "bwolodko" wrote: > > > > --- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > > > > > I'm beginning to take this personal. > > > > > > I am trying to create grouped optionbuttons. The language reference > > > says it goes like this. > > > > > > - Create the first button. Set the group property to true. > > > - Create the subsequent buttons group property to false. > > > > > > They will all be in the same group. Idea being that within that group > > > only 1 button can be set at a time. Clicking on a button will clear > > > any button already set. > > > > > > This is not happening for me. I can set all buttons no matter what. > > > > > > I'm doing something wrong. Somebody please tell me what it is. > > > > > > At your service ... > > > > > > Randall Jones > > > randalljones@ > > > AE7RJ > > > > > > "We can't solve problems by using the same kind of thinking we used > > > when we created them." > > > --Albert Einstein (1879-1955) > > > > > Don't you just love programming with less than stellar examples ... > > especially when you are just learning as I am as well.. > > > > I am developing for a CuWin3500 HMI device, having CE 5.0 in it. > > > > I posed a similar question a few weeks ago, and did not get any replys. > > > > I have the same issue, with Radio or Option Buttons. > > > > What I found was that I had to do the following > > > > Option Explicit > > Dim HoleType > > > > Sub OB1_Click > > HoleType="Mechanical" > > OB1.ForeColor = &H00C0& > > OB1.Value = True > > OB2.Value = False > > OB2.ForeColor =&H& > > OB3.Value = False > > OB3.ForeColor =&H& > > OB4.Value = False > > OB4.ForeColor =&H& > > End Sub > > > > Sub OB2_Click > > HoleType="Hand Hole" > > OB2.ForeColor =&H00C0& > > OB2.Value = True > > OB1.Value = False > > OB1.ForeColor =&H& > > OB3.Value = False > > OB3.ForeColor =&H& > > OB4.Value = False > > OB4.ForeColor =&H& > > End Sub > > > > etc for each radio button > > > > In essence, make one button's Value TRUE, and all the rest False > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to nsb-ce@googlegroups.com To unsubscribe from this group, send email to nsb-ce+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~--~~~~--~~
[nsbasic-ce] Re: Radio Buttons ...
Randall, I tested this on PPC2003 device and it works. I assume your reference of it working on a WM2003 refers to the same OS as PC2003. So the latest devices using OS of WM5 or WM6 is now broken. Try placing the Option buttons inside a "Frame" object. See if this makes a difference - with the options inside a Frame maybe the OS will detect they are grouped. Joe --- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > joespan123, > > I can't get the grouping to work using any method ... even AddObject > instead of the IDE. > > However ... the same code executed on a WM2003 device works just > fine. > > I find that quite interesting. > > At your service ... > > Randall Jones > AE7RJ > > > > > > Hi, > > > > I just tried the Option button's by adding 2 buttons to a form and setting > > the 2nd one Group=False. Below is the generated code. > > > > It works for me - that is selecting a option button forces the other button > > to unselect. > > > > Cut and paste this code into a TEXT file and load it up in the editor and > > run it. See if it works. > > > > > > > > '*** Begin Generated Code *** > > > > > > Form1_Show 'Default Form > > > > Dim Form1_Temp > > Sub Form1_Show > >On Error Resume Next > > > >UpdateScreen > > > >If IsEmpty(Form1_Temp) Then > > AddObject "Frame", "Form1_Form", 0, 0, Output.Width, Output.Height > > Form1_Form.Visible = False > > Form1_Form.BackColor = 12632256 > > AddObject "PictureBox", "Form1", 0, 0, 0, 0, Form1_Form > > Form1.BorderStyle = 0 > > Form1.Move 0, 0, Form1_Form.Width * 15, Form1_Form.Height * 15 > > Set Form1_Temp = Form1 > > Form1_Form.Caption = "Form1" > > > > AddObject "OptionButton", "OptionButton1", 27, 33, 92, 21, Form1_Form > > OptionButton1.BackColor = 12632256 > > OptionButton1.Caption = "OptionButton1" > > OptionButton1.FontSize = 8.25 > > ' > > AddObject "OptionButton", "OptionButton2", 32, 89, 92, 21, Form1_Form > > OptionButton2.BackColor = 12632256 > > OptionButton2.Caption = "OptionButton2" > > OptionButton2.FontSize = 8.25 > > OptionButton2.Group = False > > ' > >End If > >On Error Goto 0 > >Form1_Form.Visible = True > >callIfExists("Form1_Load") > > End Sub 'Form1_Show > > > > Sub Form1_Hide > >If IsEmpty(Form1_Temp) Then > > Err.Raise 44000, , "Form not loaded" > > Exit Sub > >End If > > > >Form1_Form.Visible = False > >callIfExists("Form1_Unload") > > End Sub 'Form1_Hide > > > > Sub CallIfExists(theSub) > > Dim s > >If ScriptEngineMajorVersion < 5 Then > > Execute("On Error Resume Next:"&theSub) 'attempt to execute it > >Else > > On Error Resume Next > > Set s = GetRef(theSub) > > If err.Number <> 0 Then Exit Sub 'it does not exist > > On Error GoTo 0 > > Execute (theSub) 'execute it > >End If > > End Sub > > > > '*** End Generated Code *** > > > > > > > > > > --- In nsbasic...@yahoogroups.com, "bwolodko" wrote: > > > > > > --- In nsbasic...@yahoogroups.com, "Randall Jones" wrote: > > > > > > > > I'm beginning to take this personal. > > > > > > > > I am trying to create grouped optionbuttons. The language reference > > > > says it goes like this. > > > > > > > > - Create the first button. Set the group property to true. > > > > - Create the subsequent buttons group property to false. > > > > > > > > They will all be in the same group. Idea being that within that group > > > > only 1 button can be set at a time. Clicking on a button will clear > > > > any button already set. > > > > > > > > This is not happening for me. I can set all buttons no matter what. > > > > > > > > I'm doing something wrong. Somebody please tell me what it is. > > > > > > > > At your service ... > > > > > > > > Randall Jones > > > > randalljones@ > > > > AE7RJ > > > > > > > > "We can't solve problems by using the same kind of thinking we used > > > > when we created them." > > > > --Albert Einstein (1879-1955) > > > > > > > Don't you just love programming with less than stellar examples ... > > > especially when you are just learning as I am as well.. > > > > > > I am developing for a CuWin3500 HMI device, having CE 5.0 in it. > > > > > > I posed a similar question a few weeks ago, and did not get any replys. > > > > > > I have the same issue, with Radio or Option Buttons. > > > > > > What I found was that I had to do the following > > > > > > Option Explicit > > > Dim HoleType > > > > > > Sub OB1_Click > > > HoleType="Mechanical" > > > OB1.ForeColor = &H00C0& > > > OB1.Value = True > > > OB2.Value = False > > > OB2.ForeColor =&H& > > > OB3.Value = False > > > OB3.ForeColor =&H& > > > OB4.Value = False > > > OB4.ForeColor =&H& > > > End Sub > > > > > > Sub OB2_Click > > > HoleType="Hand Hole" > > > OB2.ForeColor =