I modified a C# application from Bob Powell that moves graphics primitives
around on the screen into a Vb.NET 2005 application. I want to modify this
application so along with moving regular geometric shapes, I can also move
the alphanumeric characters as well. For example I place the character "A" on
the screen and when I point to it with the mouse the character will be
outlined and while holding down the left mouse button move the "A" somewhere
else on the screen.

Since I learn best by example I wrote another class for the Characters, but
it doesn't work. I asked Bob Powell and he suggested I convert the characters
to glyphs and hit test these, but since VB.NET's only resembalance to the
Visual Basic programming language is in name only I'm now completely lost.

Here is the Class I wrote:
Public Class DrawText
Inherits Primitive

Public Sub New()
MyBase.New()
End Sub

Public Overloads Overrides Sub Draw(ByVal g As Graphics)
Dim b As New SolidBrush(Me.Color)
Dim txt As String = "Aa"
'Dim big_font As New Font("Times New Roman", 30, FontStyle.Bold)
'g.TextRenderingHint =
Drawing.Text.TextRenderingHint.AntiAliasGridFit
'g.DrawString(txt, big_font, Brushes.Black, 10, 100)

'g.FillRectangle(b, New Rectangle(Me.Location, Me.Size))
'b.Dispose()

'Create a GraphicsPath
Dim graphics_path As New Drawing2D.GraphicsPath
'Add some text to the path
graphics_path.AddString(txt, _
New FontFamily("Times New Roman"), _
CInt(FontStyle.Bold), _
80, New Point(10, 100), _
StringFormat.GenericTypographic)

g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
g.FillPath(Brushes.White, graphics_path)
g.DrawPath(New Pen(Drawing.Color.Black, 3), graphics_path)
b.Dispose()
If Highlight Then
Dim p As New Pen(Drawing.Color.Red, 3)
p.DashStyle = Drawing2D.DashStyle.DashDot
g.DrawRectangle(p, New Rectangle(Me.Location, Me.Size))
p.Dispose()
End If
End Sub

Public Overloads Overrides Function HitTest(ByVal p As Point) As
Boolean
Dim pth As New Drawing2D.GraphicsPath()
pth.AddEllipse(New Rectangle(Location, Size))
Dim retval As Boolean = pth.IsVisible(p)
pth.Dispose()
Return retval
End Function
End Class

Can someone tell me what I'm doing wrong?
--
Mark

Re: Moving character Glyphs by Mike

Mike
Sat May 10 06:07:12 CDT 2008

"Mark" <Mark@discussions.microsoft.com> wrote in message
news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...

> I modified a C# application from Bob Powell that moves graphics
> primitives around on the screen into a Vb.NET 2005 application.
> I want to modify this application so along with moving regular
> geometric shapes, I can also move the alphanumeric characters as
> well. Since I learn best by example I wrote another class for the
> Characters, but it doesn't work. I asked Bob Powell and he
> suggested I convert the characters to glyphs and hit test these,
> but since VB.NET's only resembalance to the Visual Basic
> programming language is in name only I'm now completely lost.

That's very strange. I am a VB6 programmer looking for somewhere to move to
and I am being told by a few people, specifically someone called Bill
McCarthy on this very newsgroup, that vb.net is indeed compatible with VB6.
But you are saying that, "VB.Net's only resemblance to the Visual Basic
programming language is in name only"? Are you sure you are correct about
that? Presumably you have some experience with vb.net programming? Is it
your opinion that vb.net is not compatible with VB6 after all? Bill McCarthy
says that it is, and I have been relying on his advice.

Mike




Re: Moving character Glyphs by Cor

Cor
Sat May 10 10:14:26 CDT 2008

Mark,

Drawing is typical Bob. So your only hope is that he sees this, or that you
mail him on his home page.

At first sight I don't see any trouble in your code, but you can test it
yourself better by setting a breakpoint and than see what happens.

http://www.bobpowell.net/

I see he has still his old website (very old MVP logo) so I don't know of
the email is valid.

Cor

"Mark" <Mark@discussions.microsoft.com> schreef in bericht
news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...
>I modified a C# application from Bob Powell that moves graphics primitives
> around on the screen into a Vb.NET 2005 application. I want to modify this
> application so along with moving regular geometric shapes, I can also move
> the alphanumeric characters as well. For example I place the character "A"
> on
> the screen and when I point to it with the mouse the character will be
> outlined and while holding down the left mouse button move the "A"
> somewhere
> else on the screen.
>
> Since I learn best by example I wrote another class for the Characters,
> but
> it doesn't work. I asked Bob Powell and he suggested I convert the
> characters
> to glyphs and hit test these, but since VB.NET's only resembalance to the
> Visual Basic programming language is in name only I'm now completely lost.
>
> Here is the Class I wrote:
> Public Class DrawText
> Inherits Primitive
>
> Public Sub New()
> MyBase.New()
> End Sub
>
> Public Overloads Overrides Sub Draw(ByVal g As Graphics)
> Dim b As New SolidBrush(Me.Color)
> Dim txt As String = "Aa"
> 'Dim big_font As New Font("Times New Roman", 30,
> FontStyle.Bold)
> 'g.TextRenderingHint =
> Drawing.Text.TextRenderingHint.AntiAliasGridFit
> 'g.DrawString(txt, big_font, Brushes.Black, 10, 100)
>
> 'g.FillRectangle(b, New Rectangle(Me.Location, Me.Size))
> 'b.Dispose()
>
> 'Create a GraphicsPath
> Dim graphics_path As New Drawing2D.GraphicsPath
> 'Add some text to the path
> graphics_path.AddString(txt, _
> New FontFamily("Times New Roman"), _
> CInt(FontStyle.Bold), _
> 80, New Point(10, 100), _
> StringFormat.GenericTypographic)
>
> g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
> g.FillPath(Brushes.White, graphics_path)
> g.DrawPath(New Pen(Drawing.Color.Black, 3), graphics_path)
> b.Dispose()
> If Highlight Then
> Dim p As New Pen(Drawing.Color.Red, 3)
> p.DashStyle = Drawing2D.DashStyle.DashDot
> g.DrawRectangle(p, New Rectangle(Me.Location, Me.Size))
> p.Dispose()
> End If
> End Sub
>
> Public Overloads Overrides Function HitTest(ByVal p As Point) As
> Boolean
> Dim pth As New Drawing2D.GraphicsPath()
> pth.AddEllipse(New Rectangle(Location, Size))
> Dim retval As Boolean = pth.IsVisible(p)
> pth.Dispose()
> Return retval
> End Function
> End Class
>
> Can someone tell me what I'm doing wrong?
> --
> Mark


OT: Re: Moving character Glyphs by Cor

Cor
Sat May 10 10:42:34 CDT 2008

Mike,

> That's very strange. I am a VB6 programmer looking for somewhere to move
> to and I am being told by a few people, specifically someone called Bill
> McCarthy on this very newsgroup, that vb.net is indeed compatible with
> VB6. But you are saying that, "VB.Net's only resemblance to the Visual
> Basic programming language is in name only"? Are you sure you are correct
> about that? Presumably you have some experience with vb.net programming?
> Is it your opinion that vb.net is not compatible with VB6 after all? Bill
> McCarthy says that it is, and I have been relying on his advice.

What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
almost completely upwards compatible with VB6.

However the tool Visual Basic '98 (1998) is very much different, this tool
was in fact for Com (as there was no Net).

The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008 with
different versions) were made for Net, while it is still possible to use
Com. However most classes which are delivered with Visual Basic '98 are in
the latter version im the Microsoft Visual Basic compatible namespace, which
is not like the Microsoft.VisualBasic namespace an official namespace from
Net and probably will disapear in future. The latter is also very bad to
handle in Visual Studio version behind the start of this millenium, while
some classes are not even in that, by instance the FlexGrid, which is a
crime to use in Visual Studio 2002-2008

So as you write that the program language VB6 is not compatible with VB.Net
then you are comparing apples and pears (Nothing wrong with that because
that is the way it is mostly incorrect written, including by me).

The tool Visual Basic '98 is not compatible with the Visual Studio Tools
behind that, however all VB program language versions are very much upwards
compatible with all VB versions AFAIK starting at VB1.

I hope this clears your misunderstanding a little bit. However Bill is in my
opinion right with his statement.

Cor



Re: Re: Moving character Glyphs by Cor

Cor
Sat May 10 11:52:06 CDT 2008

Correction, the name of the tool was not Visual Basic 98 however Visual
Studio 6 (not VB6)

Cor

"Cor Ligthert[MVP]" <notmyfirstname@planet.nl> schreef in bericht
news:971F5330-9FC2-4A1C-A362-995A421A851A@microsoft.com...
> Mike,
>
>> That's very strange. I am a VB6 programmer looking for somewhere to move
>> to and I am being told by a few people, specifically someone called Bill
>> McCarthy on this very newsgroup, that vb.net is indeed compatible with
>> VB6. But you are saying that, "VB.Net's only resemblance to the Visual
>> Basic programming language is in name only"? Are you sure you are correct
>> about that? Presumably you have some experience with vb.net programming?
>> Is it your opinion that vb.net is not compatible with VB6 after all? Bill
>> McCarthy says that it is, and I have been relying on his advice.
>
> What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
> almost completely upwards compatible with VB6.
>
> However the tool Visual Basic '98 (1998) is very much different, this tool
> was in fact for Com (as there was no Net).
>
> The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008 with
> different versions) were made for Net, while it is still possible to use
> Com. However most classes which are delivered with Visual Basic '98 are in
> the latter version im the Microsoft Visual Basic compatible namespace,
> which is not like the Microsoft.VisualBasic namespace an official
> namespace from Net and probably will disapear in future. The latter is
> also very bad to handle in Visual Studio version behind the start of this
> millenium, while some classes are not even in that, by instance the
> FlexGrid, which is a crime to use in Visual Studio 2002-2008
>
> So as you write that the program language VB6 is not compatible with
> VB.Net then you are comparing apples and pears (Nothing wrong with that
> because that is the way it is mostly incorrect written, including by me).
>
> The tool Visual Basic '98 is not compatible with the Visual Studio Tools
> behind that, however all VB program language versions are very much
> upwards compatible with all VB versions AFAIK starting at VB1.
>
> I hope this clears your misunderstanding a little bit. However Bill is in
> my opinion right with his statement.
>
> Cor
>
>


Re: Re: Moving character Glyphs by Bill

Bill
Sat May 10 12:12:35 CDT 2008

Actually it was named VB6, or at least the exe was. But it was installed in
the VB98 folder by default.


"Cor Ligthert[MVP]" <notmyfirstname@planet.nl> wrote in message
news:427AD3EE-43A3-46AA-A2CD-1F9AA1E2BAB6@microsoft.com...
> Correction, the name of the tool was not Visual Basic 98 however Visual
> Studio 6 (not VB6)
>
> Cor
>
> "Cor Ligthert[MVP]" <notmyfirstname@planet.nl> schreef in bericht
> news:971F5330-9FC2-4A1C-A362-995A421A851A@microsoft.com...
>> Mike,
>>
>>> That's very strange. I am a VB6 programmer looking for somewhere to move
>>> to and I am being told by a few people, specifically someone called Bill
>>> McCarthy on this very newsgroup, that vb.net is indeed compatible with
>>> VB6. But you are saying that, "VB.Net's only resemblance to the Visual
>>> Basic programming language is in name only"? Are you sure you are
>>> correct about that? Presumably you have some experience with vb.net
>>> programming? Is it your opinion that vb.net is not compatible with VB6
>>> after all? Bill McCarthy says that it is, and I have been relying on his
>>> advice.
>>
>> What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
>> almost completely upwards compatible with VB6.
>>
>> However the tool Visual Basic '98 (1998) is very much different, this
>> tool was in fact for Com (as there was no Net).
>>
>> The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008
>> with different versions) were made for Net, while it is still possible to
>> use Com. However most classes which are delivered with Visual Basic '98
>> are in the latter version im the Microsoft Visual Basic compatible
>> namespace, which is not like the Microsoft.VisualBasic namespace an
>> official namespace from Net and probably will disapear in future. The
>> latter is also very bad to handle in Visual Studio version behind the
>> start of this millenium, while some classes are not even in that, by
>> instance the FlexGrid, which is a crime to use in Visual Studio 2002-2008
>>
>> So as you write that the program language VB6 is not compatible with
>> VB.Net then you are comparing apples and pears (Nothing wrong with that
>> because that is the way it is mostly incorrect written, including by me).
>>
>> The tool Visual Basic '98 is not compatible with the Visual Studio Tools
>> behind that, however all VB program language versions are very much
>> upwards compatible with all VB versions AFAIK starting at VB1.
>>
>> I hope this clears your misunderstanding a little bit. However Bill is in
>> my opinion right with his statement.
>>
>> Cor
>>
>>
>


Re: Re: Moving character Glyphs by Cor

Cor
Sat May 10 13:29:05 CDT 2008

Bill,

Because I was in doubt I took the old installation CD, on that was written
Visual Studio 6

Cor

"Bill McCarthy" <Bill@N0SPAM.com> schreef in bericht
news:D0AC10E5-2028-4629-B566-7B650A558A12@microsoft.com...
> Actually it was named VB6, or at least the exe was. But it was installed
> in the VB98 folder by default.
>
>
> "Cor Ligthert[MVP]" <notmyfirstname@planet.nl> wrote in message
> news:427AD3EE-43A3-46AA-A2CD-1F9AA1E2BAB6@microsoft.com...
>> Correction, the name of the tool was not Visual Basic 98 however Visual
>> Studio 6 (not VB6)
>>
>> Cor
>>
>> "Cor Ligthert[MVP]" <notmyfirstname@planet.nl> schreef in bericht
>> news:971F5330-9FC2-4A1C-A362-995A421A851A@microsoft.com...
>>> Mike,
>>>
>>>> That's very strange. I am a VB6 programmer looking for somewhere to
>>>> move to and I am being told by a few people, specifically someone
>>>> called Bill McCarthy on this very newsgroup, that vb.net is indeed
>>>> compatible with VB6. But you are saying that, "VB.Net's only
>>>> resemblance to the Visual Basic programming language is in name only"?
>>>> Are you sure you are correct about that? Presumably you have some
>>>> experience with vb.net programming? Is it your opinion that vb.net is
>>>> not compatible with VB6 after all? Bill McCarthy says that it is, and I
>>>> have been relying on his advice.
>>>
>>> What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
>>> almost completely upwards compatible with VB6.
>>>
>>> However the tool Visual Basic '98 (1998) is very much different, this
>>> tool was in fact for Com (as there was no Net).
>>>
>>> The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008
>>> with different versions) were made for Net, while it is still possible
>>> to use Com. However most classes which are delivered with Visual Basic
>>> '98 are in the latter version im the Microsoft Visual Basic compatible
>>> namespace, which is not like the Microsoft.VisualBasic namespace an
>>> official namespace from Net and probably will disapear in future. The
>>> latter is also very bad to handle in Visual Studio version behind the
>>> start of this millenium, while some classes are not even in that, by
>>> instance the FlexGrid, which is a crime to use in Visual Studio
>>> 2002-2008
>>>
>>> So as you write that the program language VB6 is not compatible with
>>> VB.Net then you are comparing apples and pears (Nothing wrong with that
>>> because that is the way it is mostly incorrect written, including by
>>> me).
>>>
>>> The tool Visual Basic '98 is not compatible with the Visual Studio Tools
>>> behind that, however all VB program language versions are very much
>>> upwards compatible with all VB versions AFAIK starting at VB1.
>>>
>>> I hope this clears your misunderstanding a little bit. However Bill is
>>> in my opinion right with his statement.
>>>
>>> Cor
>>>
>>>
>>
>


Re: Re: Moving character Glyphs by Cor

Cor
Sat May 10 13:30:45 CDT 2008

Sorry,

You are right, that what I wrote in my last reply about was the tool
including C++, there were as well more limited versions.

Cor

"Cor Ligthert[MVP]" <notmyfirstname@planet.nl> schreef in bericht
news:427AD3EE-43A3-46AA-A2CD-1F9AA1E2BAB6@microsoft.com...
> Correction, the name of the tool was not Visual Basic 98 however Visual
> Studio 6 (not VB6)
>
> Cor
>
> "Cor Ligthert[MVP]" <notmyfirstname@planet.nl> schreef in bericht
> news:971F5330-9FC2-4A1C-A362-995A421A851A@microsoft.com...
>> Mike,
>>
>>> That's very strange. I am a VB6 programmer looking for somewhere to move
>>> to and I am being told by a few people, specifically someone called Bill
>>> McCarthy on this very newsgroup, that vb.net is indeed compatible with
>>> VB6. But you are saying that, "VB.Net's only resemblance to the Visual
>>> Basic programming language is in name only"? Are you sure you are
>>> correct about that? Presumably you have some experience with vb.net
>>> programming? Is it your opinion that vb.net is not compatible with VB6
>>> after all? Bill McCarthy says that it is, and I have been relying on his
>>> advice.
>>
>> What Bill writes is very true, the languages VB7, VB7.1 VB8 and VB9 are
>> almost completely upwards compatible with VB6.
>>
>> However the tool Visual Basic '98 (1998) is very much different, this
>> tool was in fact for Com (as there was no Net).
>>
>> The tools after Visual Basic 1998 (numbered 2002, 2003 2005 and 2008
>> with different versions) were made for Net, while it is still possible to
>> use Com. However most classes which are delivered with Visual Basic '98
>> are in the latter version im the Microsoft Visual Basic compatible
>> namespace, which is not like the Microsoft.VisualBasic namespace an
>> official namespace from Net and probably will disapear in future. The
>> latter is also very bad to handle in Visual Studio version behind the
>> start of this millenium, while some classes are not even in that, by
>> instance the FlexGrid, which is a crime to use in Visual Studio 2002-2008
>>
>> So as you write that the program language VB6 is not compatible with
>> VB.Net then you are comparing apples and pears (Nothing wrong with that
>> because that is the way it is mostly incorrect written, including by me).
>>
>> The tool Visual Basic '98 is not compatible with the Visual Studio Tools
>> behind that, however all VB program language versions are very much
>> upwards compatible with all VB versions AFAIK starting at VB1.
>>
>> I hope this clears your misunderstanding a little bit. However Bill is in
>> my opinion right with his statement.
>>
>> Cor
>>
>>
>


Re: Moving character Glyphs by Mark

Mark
Sat May 10 17:12:00 CDT 2008

Mike:
Please forgive me for that comment. I have used VB6 for quite awhile and
what I once could do easily in VB6 has now been complicated by VB.NET and the
dotnet framework.

--Mark


"Mike Williams" wrote:

> "Mark" <Mark@discussions.microsoft.com> wrote in message
> news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...
>
> > I modified a C# application from Bob Powell that moves graphics
> > primitives around on the screen into a Vb.NET 2005 application.
> > I want to modify this application so along with moving regular
> > geometric shapes, I can also move the alphanumeric characters as
> > well. Since I learn best by example I wrote another class for the
> > Characters, but it doesn't work. I asked Bob Powell and he
> > suggested I convert the characters to glyphs and hit test these,
> > but since VB.NET's only resembalance to the Visual Basic
> > programming language is in name only I'm now completely lost.
>
> That's very strange. I am a VB6 programmer looking for somewhere to move to
> and I am being told by a few people, specifically someone called Bill
> McCarthy on this very newsgroup, that vb.net is indeed compatible with VB6.
> But you are saying that, "VB.Net's only resemblance to the Visual Basic
> programming language is in name only"? Are you sure you are correct about
> that? Presumably you have some experience with vb.net programming? Is it
> your opinion that vb.net is not compatible with VB6 after all? Bill McCarthy
> says that it is, and I have been relying on his advice.
>
> Mike
>
>
>
>

Re: Moving character Glyphs by Mark

Mark
Sat May 10 17:23:00 CDT 2008

Cor:
I did write Bob Powell. HE was the one who suggested using glyphs. What I
don't understand is how I get VB.NET to recongnize that the character I'm
pointing too is a glyph. All fonts are basically glyphs, so if I point to a
character glyph I should be able to hit test it.
--
Mark


"Cor Ligthert[MVP]" wrote:

> Mark,
>
> Drawing is typical Bob. So your only hope is that he sees this, or that you
> mail him on his home page.
>
> At first sight I don't see any trouble in your code, but you can test it
> yourself better by setting a breakpoint and than see what happens.
>
> http://www.bobpowell.net/
>
> I see he has still his old website (very old MVP logo) so I don't know of
> the email is valid.
>
> Cor
>
> "Mark" <Mark@discussions.microsoft.com> schreef in bericht
> news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...
> >I modified a C# application from Bob Powell that moves graphics primitives
> > around on the screen into a Vb.NET 2005 application. I want to modify this
> > application so along with moving regular geometric shapes, I can also move
> > the alphanumeric characters as well. For example I place the character "A"
> > on
> > the screen and when I point to it with the mouse the character will be
> > outlined and while holding down the left mouse button move the "A"
> > somewhere
> > else on the screen.
> >
> > Since I learn best by example I wrote another class for the Characters,
> > but
> > it doesn't work. I asked Bob Powell and he suggested I convert the
> > characters
> > to glyphs and hit test these, but since VB.NET's only resembalance to the
> > Visual Basic programming language is in name only I'm now completely lost.
> >
> > Here is the Class I wrote:
> > Public Class DrawText
> > Inherits Primitive
> >
> > Public Sub New()
> > MyBase.New()
> > End Sub
> >
> > Public Overloads Overrides Sub Draw(ByVal g As Graphics)
> > Dim b As New SolidBrush(Me.Color)
> > Dim txt As String = "Aa"
> > 'Dim big_font As New Font("Times New Roman", 30,
> > FontStyle.Bold)
> > 'g.TextRenderingHint =
> > Drawing.Text.TextRenderingHint.AntiAliasGridFit
> > 'g.DrawString(txt, big_font, Brushes.Black, 10, 100)
> >
> > 'g.FillRectangle(b, New Rectangle(Me.Location, Me.Size))
> > 'b.Dispose()
> >
> > 'Create a GraphicsPath
> > Dim graphics_path As New Drawing2D.GraphicsPath
> > 'Add some text to the path
> > graphics_path.AddString(txt, _
> > New FontFamily("Times New Roman"), _
> > CInt(FontStyle.Bold), _
> > 80, New Point(10, 100), _
> > StringFormat.GenericTypographic)
> >
> > g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
> > g.FillPath(Brushes.White, graphics_path)
> > g.DrawPath(New Pen(Drawing.Color.Black, 3), graphics_path)
> > b.Dispose()
> > If Highlight Then
> > Dim p As New Pen(Drawing.Color.Red, 3)
> > p.DashStyle = Drawing2D.DashStyle.DashDot
> > g.DrawRectangle(p, New Rectangle(Me.Location, Me.Size))
> > p.Dispose()
> > End If
> > End Sub
> >
> > Public Overloads Overrides Function HitTest(ByVal p As Point) As
> > Boolean
> > Dim pth As New Drawing2D.GraphicsPath()
> > pth.AddEllipse(New Rectangle(Location, Size))
> > Dim retval As Boolean = pth.IsVisible(p)
> > pth.Dispose()
> > Return retval
> > End Function
> > End Class
> >
> > Can someone tell me what I'm doing wrong?
> > --
> > Mark
>

Re: Moving character Glyphs by Bill

Bill
Sat May 10 20:55:25 CDT 2008

Post the code you would use in VB6


"Mark" <Mark@discussions.microsoft.com> wrote in message
news:39887118-6EDA-4E0F-A3FE-A6E2CBA9DF3A@microsoft.com...
> Mike:
> Please forgive me for that comment. I have used VB6 for quite awhile and
> what I once could do easily in VB6 has now been complicated by VB.NET and
> the
> dotnet framework.
>
> --Mark
>
>
> "Mike Williams" wrote:
>
>> "Mark" <Mark@discussions.microsoft.com> wrote in message
>> news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...
>>
>> > I modified a C# application from Bob Powell that moves graphics
>> > primitives around on the screen into a Vb.NET 2005 application.
>> > I want to modify this application so along with moving regular
>> > geometric shapes, I can also move the alphanumeric characters as
>> > well. Since I learn best by example I wrote another class for the
>> > Characters, but it doesn't work. I asked Bob Powell and he
>> > suggested I convert the characters to glyphs and hit test these,
>> > but since VB.NET's only resembalance to the Visual Basic
>> > programming language is in name only I'm now completely lost.
>>
>> That's very strange. I am a VB6 programmer looking for somewhere to move
>> to
>> and I am being told by a few people, specifically someone called Bill
>> McCarthy on this very newsgroup, that vb.net is indeed compatible with
>> VB6.
>> But you are saying that, "VB.Net's only resemblance to the Visual Basic
>> programming language is in name only"? Are you sure you are correct about
>> that? Presumably you have some experience with vb.net programming? Is it
>> your opinion that vb.net is not compatible with VB6 after all? Bill
>> McCarthy
>> says that it is, and I have been relying on his advice.
>>
>> Mike
>>
>>
>>
>>


Re: Moving character Glyphs by Cor

Cor
Sun May 11 02:29:44 CDT 2008

Mark,

As Bob not can tell you this, I am for sure not the best in helping you
with this.
Drawing is absolute not my favorite part of programming.

I only wanted you to supply the link to Bob his homepage.

Sorry,

Cor


"Mark" <Mark@discussions.microsoft.com> schreef in bericht
news:D0E3D567-2E2F-40F2-A40F-F8BB937479D4@microsoft.com...
> Cor:
> I did write Bob Powell. HE was the one who suggested using glyphs. What I
> don't understand is how I get VB.NET to recongnize that the character I'm
> pointing too is a glyph. All fonts are basically glyphs, so if I point to
> a
> character glyph I should be able to hit test it.
> --
> Mark
>
>
> "Cor Ligthert[MVP]" wrote:
>
>> Mark,
>>
>> Drawing is typical Bob. So your only hope is that he sees this, or that
>> you
>> mail him on his home page.
>>
>> At first sight I don't see any trouble in your code, but you can test it
>> yourself better by setting a breakpoint and than see what happens.
>>
>> http://www.bobpowell.net/
>>
>> I see he has still his old website (very old MVP logo) so I don't know of
>> the email is valid.
>>
>> Cor
>>
>> "Mark" <Mark@discussions.microsoft.com> schreef in bericht
>> news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...
>> >I modified a C# application from Bob Powell that moves graphics
>> >primitives
>> > around on the screen into a Vb.NET 2005 application. I want to modify
>> > this
>> > application so along with moving regular geometric shapes, I can also
>> > move
>> > the alphanumeric characters as well. For example I place the character
>> > "A"
>> > on
>> > the screen and when I point to it with the mouse the character will be
>> > outlined and while holding down the left mouse button move the "A"
>> > somewhere
>> > else on the screen.
>> >
>> > Since I learn best by example I wrote another class for the Characters,
>> > but
>> > it doesn't work. I asked Bob Powell and he suggested I convert the
>> > characters
>> > to glyphs and hit test these, but since VB.NET's only resembalance to
>> > the
>> > Visual Basic programming language is in name only I'm now completely
>> > lost.
>> >
>> > Here is the Class I wrote:
>> > Public Class DrawText
>> > Inherits Primitive
>> >
>> > Public Sub New()
>> > MyBase.New()
>> > End Sub
>> >
>> > Public Overloads Overrides Sub Draw(ByVal g As Graphics)
>> > Dim b As New SolidBrush(Me.Color)
>> > Dim txt As String = "Aa"
>> > 'Dim big_font As New Font("Times New Roman", 30,
>> > FontStyle.Bold)
>> > 'g.TextRenderingHint =
>> > Drawing.Text.TextRenderingHint.AntiAliasGridFit
>> > 'g.DrawString(txt, big_font, Brushes.Black, 10, 100)
>> >
>> > 'g.FillRectangle(b, New Rectangle(Me.Location, Me.Size))
>> > 'b.Dispose()
>> >
>> > 'Create a GraphicsPath
>> > Dim graphics_path As New Drawing2D.GraphicsPath
>> > 'Add some text to the path
>> > graphics_path.AddString(txt, _
>> > New FontFamily("Times New Roman"), _
>> > CInt(FontStyle.Bold), _
>> > 80, New Point(10, 100), _
>> > StringFormat.GenericTypographic)
>> >
>> > g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
>> > g.FillPath(Brushes.White, graphics_path)
>> > g.DrawPath(New Pen(Drawing.Color.Black, 3), graphics_path)
>> > b.Dispose()
>> > If Highlight Then
>> > Dim p As New Pen(Drawing.Color.Red, 3)
>> > p.DashStyle = Drawing2D.DashStyle.DashDot
>> > g.DrawRectangle(p, New Rectangle(Me.Location, Me.Size))
>> > p.Dispose()
>> > End If
>> > End Sub
>> >
>> > Public Overloads Overrides Function HitTest(ByVal p As Point) As
>> > Boolean
>> > Dim pth As New Drawing2D.GraphicsPath()
>> > pth.AddEllipse(New Rectangle(Location, Size))
>> > Dim retval As Boolean = pth.IsVisible(p)
>> > pth.Dispose()
>> > Return retval
>> > End Function
>> > End Class
>> >
>> > Can someone tell me what I'm doing wrong?
>> > --
>> > Mark
>>


Re: Moving character Glyphs by Al

Al
Mon May 12 13:13:58 CDT 2008



--
Al Reid
"Mike Williams" <mikea@whiskyandCoke.com> wrote in message news:uWPVA4osIHA.3564@TK2MSFTNGP03.phx.gbl...
> "Mark" <Mark@discussions.microsoft.com> wrote in message
> news:F9906801-F032-4B21-8E86-ACB403DE7C70@microsoft.com...
>
> > I modified a C# application from Bob Powell that moves graphics
> > primitives around on the screen into a Vb.NET 2005 application.
> > I want to modify this application so along with moving regular
> > geometric shapes, I can also move the alphanumeric characters as
> > well. Since I learn best by example I wrote another class for the
> > Characters, but it doesn't work. I asked Bob Powell and he
> > suggested I convert the characters to glyphs and hit test these,
> > but since VB.NET's only resembalance to the Visual Basic
> > programming language is in name only I'm now completely lost.
>
> That's very strange. I am a VB6 programmer looking for somewhere to move to
> and I am being told by a few people, specifically someone called Bill
> McCarthy on this very newsgroup, that vb.net is indeed compatible with VB6.
> But you are saying that, "VB.Net's only resemblance to the Visual Basic
> programming language is in name only"? Are you sure you are correct about
> that? Presumably you have some experience with vb.net programming? Is it
> your opinion that vb.net is not compatible with VB6 after all? Bill McCarthy
> says that it is, and I have been relying on his advice.
>
> Mike
>

Vb.Net and VB6 are so similar that I find that switching between development on either one several times a day is easy, simple and
painless. The language/syntax is, for the most part, identical. It's just a matter of learning the .Net Framework.

YMMV
--
Al Reid