Paul
I have built a new project and reproduces the error here is a copy of all my
code
Please note that on form2 the toolbarbuttonclick sub never gets fired...
thanks so much for taking the time to look at this!
nathan
module1.vb
Imports OpenNETCF.Windows.Forms
Imports Microsoft.WindowsCE.Forms
Module Module1
Public NavFilter As OpenNETCF.Windows.Forms.NavFilter
Sub Main()
NavFilter = New OpenNETCF.Windows.Forms.NavFilter
Application2.AddMessageFilter(NavFilter)
Application2.Run(New Form1)
If Not NavFilter Is Nothing Then
Application2.RemoveMessageFilter(NavFilter)
NavFilter = Nothing
End If
End Sub
End Module
form1.vb
Imports OpenNETCF.Windows.Forms
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim f As Form2
f = New Form2
Application2.ShowDialog(f, False)
f.Dispose()
f = Nothing
End Sub
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
End Sub
End Class
Form2.vb
Public Class Form2
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
ToolBar1.ButtonClick
MsgBox("here")
End Sub
End Class
NavFilter.vb
Imports OpenNETCF.Windows.Forms
Imports Microsoft.WindowsCE.Forms
Namespace OpenNETCF.Windows.Forms
Public Enum WinMsg As Integer
WM_CLOSE = &H10
WM_PAINT = &HF
WM_KEYDOWN = &H100
WM_KEYUP = &H101
End Enum
Public Delegate Sub KeyEvent(ByRef hwnd As Integer, ByRef e As KeyEventArgs)
' this class handles all the nav keydown events
' there is a global variable ActivePanel which we look at when we navigate
around our form
' if any controls are not on the active panel we wont navigate to them
' if a control is out of view we set the scrolling position so the control
is in view...
Public Class NavFilter
Implements IMessageFilter
Private mHwnds As ArrayList
Public Event KeyDown As KeyEvent
Sub New()
mHwnds = New ArrayList
End Sub
Public Property Hwnds() As ArrayList
Get
Return mHwnds
End Get
Set(ByVal value As ArrayList)
mHwnds = value
End Set
End Property
Public Function PreFilterMessage(ByRef m As
Microsoft.WindowsCE.Forms.Message) As Boolean Implements
IMessageFilter.PreFilterMessage
If mHwnds.Contains(m.HWnd.ToInt32) Then
If m.Msg = WinMsg.WM_KEYDOWN Then
Dim keyArgs As New KeyEventArgs(m.WParam.ToInt32)
If keyArgs.KeyValue = Keys.Up Or keyArgs.KeyValue = Keys.Down Or
keyArgs.KeyValue = Keys.Left Or keyArgs.KeyValue = Keys.Right Then
' this is where we need to process our nav...
' we raise the event because we will hanbdle everything else in ModMain
' this just keeps things clean in here
RaiseEvent KeyDown(m.HWnd.ToInt32, keyArgs)
' only handle this if we can.. else this will be sent through the normal
processing system
If keyArgs.Handled Then
Return True
End If
End If
End If
End If
Return False
End Function
End Class
End Namespace
> You'd want to actually try to build a new project from scratch, so that
> you can send *all* of the code. Copy and paste is just going to create
[quoted text clipped - 115 lines]
>>>>>>>>>
>>>>>>>>> Nathan
Paul G. Tobey [eMVP] - 03 Apr 2006 23:50 GMT
What version of .NET CF are you targeting? I don't see the information in
your previous messages and I don't recognize anything as absolutely being 1
or 2...
Paul T.
> Paul
>
[quoted text clipped - 309 lines]
>>>>>>>>>>
>>>>>>>>>> Nathan
Nathan Franklin - 03 Apr 2006 23:56 GMT
visual studio 2005 cf 2
> What version of .NET CF are you targeting? I don't see the information in
> your previous messages and I don't recognize anything as absolutely being
[quoted text clipped - 315 lines]
>>>>>>>>>>>
>>>>>>>>>>> Nathan
Paul G. Tobey [eMVP] - 04 Apr 2006 00:03 GMT
And, therefore, OpenNETCF 2.0 beta?
Paul T.
> visual studio 2005 cf 2
>
[quoted text clipped - 318 lines]
>>>>>>>>>>>>
>>>>>>>>>>>> Nathan
Nathan Franklin - 04 Apr 2006 00:07 GMT
yes it is opennetcf 2.0 beta.. is this not good?
> And, therefore, OpenNETCF 2.0 beta?
>
[quoted text clipped - 326 lines]
>>>>>>>>>>>>>
>>>>>>>>>>>>> Nathan
<ctacke/> - 04 Apr 2006 00:21 GMT
The beta should be fine. Have you verified with Remote Spy++ that the
toolbar is in fact a child of the Form? Pocket PC is a little unorthodox in
its UI at times, and if the toolbar is not a child of the Form, that might
explain a few things.
-Chris
> yes it is opennetcf 2.0 beta.. is this not good?
>
[quoted text clipped - 331 lines]
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Nathan
Nathan Franklin - 04 Apr 2006 00:30 GMT
Chris,
It appears that the toolbar is not child to the form. this does explain, but
how can I fix it? I have absolutly no idea!
thanks mate
nathan
> The beta should be fine. Have you verified with Remote Spy++ that the
> toolbar is in fact a child of the Form? Pocket PC is a little unorthodox
[quoted text clipped - 339 lines]
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Nathan
<ctacke/> - 04 Apr 2006 00:58 GMT
Yes, it explains a bit. Is the Toolbar even in the same process? I know it
sounds like a strange question, but take the "Form Caption" for example in
Pocket PC. It's actually not the caption of the form - it's a separate
process that allows for the notification icons, etc.
-Chris
> Chris,
>
[quoted text clipped - 349 lines]
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Nathan
Nathan Franklin - 04 Apr 2006 01:19 GMT
The toolbar displays as top lvl.
here is what remote spy says
"<No Name>" (menu_worker)
- "<No Name>" (ToolbarWindow32)
it doesnt come under the Form1 Or Form2 or the app exe name and that is the
process cause I matched the hwnd's up to it
> Yes, it explains a bit. Is the Toolbar even in the same process? I know
> it sounds like a strange question, but take the "Form Caption" for example
[quoted text clipped - 357 lines]
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Nathan
<ctacke/> - 04 Apr 2006 05:43 GMT
That explains why you don't get its messages directly. Next you have to
reverse engineer how it's communicating with your app. Ah the joys of the
mobile platform....
-Chris
> The toolbar displays as top lvl.
>
[quoted text clipped - 367 lines]
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Nathan
Paul G. Tobey [eMVP] - 04 Apr 2006 00:00 GMT
Still some items missing there, too, I think. InitializeComponent? Just
ZIP up the whole project and post it. It won't come through to those using
the Web interface, but I'll get it fine.
Paul T.
> Paul
>
[quoted text clipped - 309 lines]
>>>>>>>>>>
>>>>>>>>>> Nathan
Nathan Franklin - 04 Apr 2006 00:05 GMT
Paul
could you please email me your email address off list as this list does not
allow binary content...
> Still some items missing there, too, I think. InitializeComponent? Just
> ZIP up the whole project and post it. It won't come through to those
[quoted text clipped - 315 lines]
>>>>>>>>>>>
>>>>>>>>>>> Nathan
Paul G. Tobey [eMVP] - 04 Apr 2006 00:18 GMT
You should be able to post binary attachments to the list with no problem,
if you're using a regular NNTP reader. If you're using the Web interface at
microsoft.com, you can't. If you look at the return address on my message
and remove "space" "no spam" "no" and "no spam", you'll get the address.
Paul T.
> Paul
>
[quoted text clipped - 321 lines]
>>>>>>>>>>>>
>>>>>>>>>>>> Nathan
Nathan Franklin - 04 Apr 2006 00:24 GMT
ok paul i have sent you a copy through...
when it ried to email it to the list outlook express errored and said binary
not allowed on a non-binary list...
> You should be able to post binary attachments to the list with no problem,
> if you're using a regular NNTP reader. If you're using the Web interface
[quoted text clipped - 333 lines]
>>>>>>>>>>>>>
>>>>>>>>>>>>> Nathan