Hi All
the following code generates an error with option strict on - Option
strict disallows late binding. Can someone please help with what needs
to be changed:
Dim sweep, totalsweep As Integer
Dim slices As Array = Split("26, 40, 34",",")
Dim colors() As Color = { _
Color.Blue, Color.LimeGreen, _
Color.Purple}
Dim brush As System.Drawing.SolidBrush
Dim g As System.Drawing.Graphics
g = Me.CreateGraphics
For i As Integer = 0 To UBound(slices)
brush = New System.Drawing.SolidBrush(colors(i))
sweep = 360 * (CLng(slices(i)) / 100) '<----PROBLEM HERE
If totalsweep + sweep > 360 Then _
sweep = 360 - totalsweep
g.FillPie(brush, New Rectangle(0, 0, 80, 80), _
totalsweep, sweep)
totalsweep += sweep
Next
Thanks
CodeMonkey. 7 4856
"CodeMonkey" <ag********@yahoo.com> schrieb: the following code generates an error with option strict on - Option strict disallows late binding. Can someone please help with what needs to be changed:
Dim sweep, totalsweep As Integer Dim slices As Array = Split("26, 40, 34",",") Dim colors() As Color = { _ Color.Blue, Color.LimeGreen, _ Color.Purple} Dim brush As System.Drawing.SolidBrush Dim g As System.Drawing.Graphics g = Me.CreateGraphics
For i As Integer = 0 To UBound(slices)
brush = New System.Drawing.SolidBrush(colors(i)) sweep = 360 * (CLng(slices(i)) / 100) '<----PROBLEM HERE
Replace the line above with this:
\\\
sweep = CInt(360 * (CLng(slices.GetValue(i)) / 100))
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
You may also want to change
Dim slices As Array = Split("26, 40, 34",",")
to
Dim slices() As String = Split("26, 40, 34", ",")
because it appears that your intention is that slices is an array of strings.
Change this line:
Dim slices As Array = Split("26, 40, 34", ",")
To
Dim slices As String() = Split("26, 40, 34", ",")
HTH,
Sam
On 6 Apr 2005 10:31:07 -0700, "CodeMonkey" <ag********@yahoo.com>
wrote: Hi All the following code generates an error with option strict on - Option strict disallows late binding. Can someone please help with what needs to be changed:
Dim sweep, totalsweep As Integer Dim slices As Array = Split("26, 40, 34",",") Dim colors() As Color = { _ Color.Blue, Color.LimeGreen, _ Color.Purple} Dim brush As System.Drawing.SolidBrush Dim g As System.Drawing.Graphics g = Me.CreateGraphics
For i As Integer = 0 To UBound(slices)
brush = New System.Drawing.SolidBrush(colors(i)) sweep = 360 * (CLng(slices(i)) / 100) '<----PROBLEM HERE If totalsweep + sweep > 360 Then _ sweep = 360 - totalsweep g.FillPie(brush, New Rectangle(0, 0, 80, 80), _ totalsweep, sweep) totalsweep += sweep Next
Thanks CodeMonkey.
B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
"AMercer" <AM*****@discussions.microsoft.com> schrieb: You may also want to change Dim slices As Array = Split("26, 40, 34",",") to Dim slices() As String = Split("26, 40, 34", ",") because it appears that your intention is that slices is an array of strings.
Full ACK. Thanks for adding that... :-).
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Or even: Dim slices As Array = Split("26, 40, 34", ",") Dim slices As String() = Split("26, 40, 34", ",")
to
Dim slices As String() = {"26", "40", "34"}
Marcie
On Wed, 06 Apr 2005 14:17:11 -0400, Samuel R. Neff
<bl****@newsgroup.nospam> wrote: Change this line:
Dim slices As Array = Split("26, 40, 34", ",")
To
Dim slices As String() = Split("26, 40, 34", ",")
HTH,
Sam
On 6 Apr 2005 10:31:07 -0700, "CodeMonkey" <ag********@yahoo.com> wrote:
Hi All the following code generates an error with option strict on - Option strict disallows late binding. Can someone please help with what needs to be changed:
Dim sweep, totalsweep As Integer Dim slices As Array = Split("26, 40, 34",",") Dim colors() As Color = { _ Color.Blue, Color.LimeGreen, _ Color.Purple} Dim brush As System.Drawing.SolidBrush Dim g As System.Drawing.Graphics g = Me.CreateGraphics
For i As Integer = 0 To UBound(slices)
brush = New System.Drawing.SolidBrush(colors(i)) sweep = 360 * (CLng(slices(i)) / 100) '<----PROBLEM HERE If totalsweep + sweep > 360 Then _ sweep = 360 - totalsweep g.FillPie(brush, New Rectangle(0, 0, 80, 80), _ totalsweep, sweep) totalsweep += sweep Next
Thanks CodeMonkey.
B-Line is now hiring one Washington D.C. area VB.NET developer for WinForms + WebServices position. Seaking mid to senior level developer. For information or to apply e-mail resume to sam_blinex_com.
Or
Dim slices As Integer() = {26, 40, 34}
Then no need for conversion later.
Sam
On Wed, 06 Apr 2005 14:31:28 -0400, Marcie Jones
<ma*********@yahoo.com> wrote: Or even:
Dim slices As Array = Split("26, 40, 34", ",") Dim slices As String() = Split("26, 40, 34", ",")
to Dim slices As String() = {"26", "40", "34"}
Marcie
On Wed, 06 Apr 2005 14:17:11 -0400, Samuel R. Neff <bl****@newsgroup.nospam> wrote:
Change this line:
Dim slices As Array = Split("26, 40, 34", ",")
To
Dim slices As String() = Split("26, 40, 34", ",")
HTH,
Sam
B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
All,
thanks for your extremely prompt and accurate help.
Regards
CodeMonkey.
Samuel R. Neff wrote: Or
Dim slices As Integer() = {26, 40, 34}
Then no need for conversion later.
Sam
On Wed, 06 Apr 2005 14:31:28 -0400, Marcie Jones <ma*********@yahoo.com> wrote:
Or even:
Dim slices As Array = Split("26, 40, 34", ",") Dim slices As String() = Split("26, 40, 34", ",")
to Dim slices As String() = {"26", "40", "34"}
Marcie
On Wed, 06 Apr 2005 14:17:11 -0400, Samuel R. Neff <bl****@newsgroup.nospam> wrote:
Change this line:
Dim slices As Array = Split("26, 40, 34", ",")
To
Dim slices As String() = Split("26, 40, 34", ",")
HTH,
Sam
B-Line is now hiring one Washington D.C. area VB.NET developer for WinForms + WebServices position. Seaking mid to senior level developer. For information or to apply e-mail resume to sam_blinex_com. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Karl Lang |
last post by:
Hi
I've created a new configuration section in Web.Config to hold the
connection string for my database. If I have Option Strict On I get a
message "Option Strict On disallows late binding" when I...
|
by: Simon Harris |
last post by:
Hi All,
I've been advised to use option strict. I've tried to read up on this, all i
can find is that it...
"disallows implicit narrowing conversions"
This kinda makes sense - Means I have...
|
by: Doug Hill |
last post by:
Please, Microsoft, update Option Explicit
Option Strict barks at late binding. We love late
binding. So Option Strict flags too many things.
Option Explicit is misleading.
It allows
Dim...
|
by: Dieter Schwerdtfeger via DotNetMonster.com |
last post by:
I have this function where i search through my database for items that were made on a specific date. The line "CType(dvClubs.Item(teller).Item(veld).ToShortDateString" gives me the error : option...
|
by: Starbuck |
last post by:
Hi
The following generates an error when Option Strict is On
Can anytell tell me how to get round this please.
Private Sub optWithTone_CheckedChanged(ByVal eventSender As System.Object, ByVal...
|
by: Heinz |
last post by:
Hi all,
I use VB.net 2003 and want to export data to Excel. Target PCs still
have Office 2000 so I could not use Microsofts PIAs. Instead I use the
included Excel 10 COM DLL from Microsoft....
|
by: Owen Mortensen |
last post by:
(This code was working in asp.net 1.1 VS2003. After upgrade to VS2005,
chokes):
in the aspx file:
<ItemTemplate>
<asp:datagrid id="dg_instr" runat="server" AutoGenerateColumns="False"...
|
by: Adotek |
last post by:
Hi All,
I've just converted a solution from .Net v1.1 to v2.0, by allowing
Visual Studio 2005 to do the conversion.
Since doing so, I am getting a compilation error as follows:
"Option...
|
by: Lynn |
last post by:
Hello,
I have a website that is working fine. I have just turned on "option strict"
and am getting an error with the parts of my code. I have fixed everything
but this section, which has me...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| | |