|
From: Paul in Toronto on 23 Jun 2008 17:21 I'm slowly teaching myself VB .NET. After getting a simple calculator program written and working on my PC, I decided it might be fun to try the same program, targetted for a WM device. The following bit of code: Private Sub numberClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0.Click lblDisplay.Text = lblDisplay.Text + sender.Text End Sub Results in this error: "The targeted version of the .NET Compact Framework does not support latebinding" My Google searches on the error can basically be summarized as: Don't use objects as variables. So... How would I get around the problem? My target device is running WM 6.1, with the .NET CF 3.5. My PC is running Windows Vista, Visual Studio .NET 2005 and various .NET versions. ** Posted from http://www.teranews.com **
From: Chris Tacke, MVP on 23 Jun 2008 19:05 An Object doesn't necessarily have a Text property, so you can't do that. You could cast it to a Control object (CType in VB IIRC) and then use your logic from there. -Chris "Paul in Toronto" <swampyfern(a)hotmail.com> wrote in message news:a1113$4860154d$7554(a)news.teranews.com... > I'm slowly teaching myself VB .NET. After getting a simple calculator > program written and working on my PC, I decided it might be fun to try the > same program, targetted for a WM device. The following bit of code: > > Private Sub numberClick(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles btn0.Click > lblDisplay.Text = lblDisplay.Text + sender.Text > End Sub > > Results in this error: "The targeted version of the .NET Compact > Framework > does not support latebinding" > > My Google searches on the error can basically be summarized as: Don't use > objects as variables. > > So... How would I get around the problem? > > My target device is running WM 6.1, with the .NET CF 3.5. > > My PC is running Windows Vista, Visual Studio .NET 2005 and various .NET > versions. > ** Posted from http://www.teranews.com **
From: Paul in Toronto on 23 Jun 2008 23:10 "Chris Tacke, MVP" <ctacke.at.opennetcf.dot.com> wrote in message news:0454546E-BC9B-4947-890E-23194E40B66B(a)microsoft.com... > An Object doesn't necessarily have a Text property, so you can't do that. > You could cast it to a Control object (CType in VB IIRC) and then use your > logic from there. > > -Chris Hi Chris. The object in this case is a button, and I was hoping to use the button's text label (a number, since it's a calculator button) to get the value that I need. I tried CType, and it gave me a different error. I'll try it again, and see how it works. Maybe I did something wrong. I'll post my results if it doesn't work. ** Posted from http://www.teranews.com **
|
Pages: 1 Prev: MoveFileEx equivalent Next: Copy files with SHFileOperation on WM5, WM6 (PocketPC) |