I have a form(frmMain), and within this form I have a DB3D being displayed through through a picture box(as shown in the .NET WinForms VB Example). I want to be able to navigate around 3D space using this 'Viewport' as i'm creating a space map making program. Problem is, though my 3D and camera commands seem to be displaying fine through this viewport...it wont take any input from the keyboard. The only input i'm able to use is ControlCameraWithArrowKeys...in which the camera will move when an arrow key is pressed. However, when I use if/then statements using ShiftKey/ControlKey, etc, even using a scan code I had no luck...i can't get any interaction within my picture box. It seems to accept other events such as menu clicks, etc...but nothing from the keyboard. The same commands seem to work when using the gdk directly(not within a form or a picture box). I'm not getting any errors at all.
I think I must be leaving something out, but not sure. To test it, i'm using the CamX variable and a label for the moment. Ideas anyone? My module code is below, thanks in advance.
Sub Main()
REM oDBDisplay.SetDisplayMode(800, 600, 32)
hOldWnd = oDBDisplay.GetHWND()
oDBDisplay.OverrideHWND(frmMain.ctlViewport.Handle.ToInt32())
oDBDisplay.SetDisplayMode(800, 600, 32)
ShowWindowAsync(hOldWnd, 0)
oDBCamera.BackdropColor(oDB2D.RGBC(0, 0, 0))
oDBCamera.AutoCamOff()
oDBCamera.PositionCamera(0, 70, -270)
oDBCamera.PointCamera(0, 0, 0)
frmMain.Show()
Application.EnableVisualStyles()
oDB3D.MakeObjectCube(1, 10)
oDB3D.PositionObject(1, 5, 5, 5)
While oDBP.LoopGDK()
REM GetCamPos()
REM MoveCamera()
If oDBInput.ShiftKey() = 1 Then CamX = 500
oDBCamera.ControlCameraUsingArrowKeys(0, 1, 1)
frmMain.Label1.Text = CamX
frmMain.Label2.Text = CamY
frmMain.Label3.Text = CamZ
oDB3D.RotateObject(1, oDB3D.ObjectAngleX(1) + 0.1, oDB3D.ObjectAngleY(1) + 0.2, oDB3D.ObjectAngleZ(1) + 0.3)
fY = (fY + 1.0!)
fZ = (fZ + 1.0!)
fA += 0.5!
CDarkGDK.oDBCore.Sync()
End While