<div dir="ltr">I created this example of using Arrays and Dictionaries in VB. Hope this helps someone.<div><br></div><div>Vic Farrell</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 6, 2017 at 2:46 PM,  <span dir="ltr">&lt;<a href="mailto:sofdev-request@edulists.com.au" target="_blank">sofdev-request@edulists.com.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send sofdev mailing list submissions to<br>
        <a href="mailto:sofdev@edulists.com.au">sofdev@edulists.com.au</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://www.edulists.com.au/mailman/listinfo/sofdev" rel="noreferrer" target="_blank">http://www.edulists.com.au/<wbr>mailman/listinfo/sofdev</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:sofdev-request@edulists.com.au">sofdev-request@edulists.com.au</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:sofdev-owner@edulists.com.au">sofdev-owner@edulists.com.au</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of sofdev digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. C# - Adding data to an Array from user input (Cooper, Michael J)<br>
   2. Re: C# - Adding data to an Array from user input (Ben Hines)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Mon, 6 Feb 2017 01:57:35 +0000<br>
From: &quot;Cooper, Michael J&quot; &lt;<a href="mailto:cooper.michael.j@edumail.vic.gov.au">cooper.michael.j@edumail.vic.<wbr>gov.au</a>&gt;<br>
Subject: [Year 12 SofDev] C# - Adding data to an Array from user input<br>
To: &quot;Year 12 Software Development Teachers&#39; Mailing List&quot;<br>
        &lt;<a href="mailto:sofdev@edulists.com.au">sofdev@edulists.com.au</a>&gt;<br>
Message-ID: &lt;<a href="mailto:89DFBCD1-CAB9-46BE-B23A-E9E3089341EE@edumail.vic.gov.au">89DFBCD1-CAB9-46BE-B23A-<wbr>E9E3089341EE@edumail.vic.gov.<wbr>au</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Hello fellow SD teachers,<br>
<br>
C# coding question - what is the best way to allow a USER to enter data into an array using a GUI, not the console?<br>
<br>
I?ve used InputBoxes and loops with Visual Basic, however InputBoxes don?t seem to be thing in C#, without adding the Microsoft.VisualBasic namepace.<br>
<br>
I can add data to an array during design time easily enough, but I want the USER to be able to click on a button and be prompted to enter data, which then populates the array.<br>
<br>
Or am I going about this the wrong way entirely and should be using another technique?<br>
<br>
Michael Cooper<br>
ICT Co-ordinator &amp; Network Support<br>
<br>
[id:image001.png@01D2440D.<wbr>0D6FCCA0]<br>
<a href="http://braybrooksc.vic.edu.au" rel="noreferrer" target="_blank">braybrooksc.vic.edu.au</a>&lt;<a href="http://www.Braybrooksc.vic.edu.au" rel="noreferrer" target="_blank">http://<wbr>www.Braybrooksc.vic.edu.au</a>&gt;<br>
Ph. 9312 2900<br>
<br>
<br>
IMPORTANT - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education and Training.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://www.edulists.com.au/pipermail/sofdev/attachments/20170206/912b1928/attachment-0001.html" rel="noreferrer" target="_blank">http://www.edulists.com.au/<wbr>pipermail/sofdev/attachments/<wbr>20170206/912b1928/attachment-<wbr>0001.html</a><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: image001.png<br>
Type: image/png<br>
Size: 9943 bytes<br>
Desc: image001.png<br>
Url : <a href="http://www.edulists.com.au/pipermail/sofdev/attachments/20170206/912b1928/image001-0001.png" rel="noreferrer" target="_blank">http://www.edulists.com.au/<wbr>pipermail/sofdev/attachments/<wbr>20170206/912b1928/image001-<wbr>0001.png</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 6 Feb 2017 03:46:24 +0000<br>
From: Ben Hines &lt;<a href="mailto:b.hines@ccg.vic.edu.au">b.hines@ccg.vic.edu.au</a>&gt;<br>
Subject: Re: [Year 12 SofDev] C# - Adding data to an Array from user<br>
        input<br>
To: &quot;Year 12 Software Development Teachers&#39; Mailing List&quot;<br>
        &lt;<a href="mailto:sofdev@edulists.com.au">sofdev@edulists.com.au</a>&gt;<br>
Message-ID: &lt;<a href="mailto:a53a1e984d4644db9e3ad129afe987b9@ccg.vic.edu.au">a53a1e984d4644db9e3ad129afe98<wbr>7b9@ccg.vic.edu.au</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Um,<br>
<br>
The problem with arrays is that they are made with a fixed size.<br>
<br>
You can easily have a textbox (or NumericInput) control, then a button that adds to the array. You will need to have a counter variable that keeps track of where you are in the array.<br>
<br>
Or you could just use a List&lt;T&gt; which has methods for adding and removing from the list (List is just an array with lots of helpful functions that make it easier to use).<br>
<br>
Hope that helps!<br>
<br>
Regards,<br>
<br>
Ben Hines<br>
<br>
<br>
Ben Hines<br>
Mathematics and ICT Teacher<br>
Senior School - Waurn Ponds<br>
(03)5241 1577<br>
<br>
[Christian College Geelong]<br>
<br>
[<a href="https://www.ccg.vic.edu.au/email/images/Enviro.jpg" rel="noreferrer" target="_blank">https://www.ccg.vic.edu.au/<wbr>email/images/Enviro.jpg</a>] Please consider the environment  before printing this email.<br>
From: <a href="mailto:sofdev-bounces@edulists.com.au">sofdev-bounces@edulists.com.au</a> [mailto:<a href="mailto:sofdev-bounces@edulists.com.au">sofdev-bounces@<wbr>edulists.com.au</a>] On Behalf Of Cooper, Michael J<br>
Sent: Monday, 6 February 2017 12:58 PM<br>
To: Year 12 Software Development Teachers&#39; Mailing List &lt;<a href="mailto:sofdev@edulists.com.au">sofdev@edulists.com.au</a>&gt;<br>
Subject: [Year 12 SofDev] C# - Adding data to an Array from user input<br>
<br>
Hello fellow SD teachers,<br>
<br>
C# coding question - what is the best way to allow a USER to enter data into an array using a GUI, not the console?<br>
<br>
I?ve used InputBoxes and loops with Visual Basic, however InputBoxes don?t seem to be thing in C#, without adding the Microsoft.VisualBasic namepace.<br>
<br>
I can add data to an array during design time easily enough, but I want the USER to be able to click on a button and be prompted to enter data, which then populates the array.<br>
<br>
Or am I going about this the wrong way entirely and should be using another technique?<br>
<br>
Michael Cooper<br>
ICT Co-ordinator &amp; Network Support<br>
<br>
[id:image001.png@01D2440D.<wbr>0D6FCCA0]<br>
<a href="http://braybrooksc.vic.edu.au" rel="noreferrer" target="_blank">braybrooksc.vic.edu.au</a>&lt;<a href="http://www.Braybrooksc.vic.edu.au" rel="noreferrer" target="_blank">http://<wbr>www.Braybrooksc.vic.edu.au</a>&gt;<br>
Ph. 9312 2900<br>
<br>
<br>
IMPORTANT - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education and Training.<br>
<br>
<br>
______________________________<wbr>__<br>
Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.<br>
<a href="http://www.mailguard.com.au" rel="noreferrer" target="_blank">http://www.mailguard.com.au</a><br>
<br>
Report this message as spam&lt;<a href="https://console.mailguard.com.au/ras/1Qd3zTUEZM/1ibn1N2QYL7pAHC9BDIL3b/0" rel="noreferrer" target="_blank">https://console.<wbr>mailguard.com.au/ras/<wbr>1Qd3zTUEZM/<wbr>1ibn1N2QYL7pAHC9BDIL3b/0</a>&gt;<br>
<br>
--<br>
This e-mail is intended for the use of the named individual or entity and may contain confidential and privileged information. Any dissemination, distribution or copying by anyone other than the intended recipient of this e-mail is strictly prohibited. If this e-mail has been received in error, then please notify Christian College or the author of this email immediately and destroy the original message. We have made every attempt to ensure this e-mail message is free from computer viruses however the attached files are provided on the basis that the user assumes all responsibility for use of the material transmitted. Views, opinions, etc. expressed reflect those of the author and not Christian College nor its associated companies and campuses which includes Eden Quality Services Pty Ltd.<br>
<br>
Message  protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.<br>
<a href="http://www.mailguard.com.au" rel="noreferrer" target="_blank">http://www.mailguard.com.au</a><br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://www.edulists.com.au/pipermail/sofdev/attachments/20170206/130837fd/attachment.html" rel="noreferrer" target="_blank">http://www.edulists.com.au/<wbr>pipermail/sofdev/attachments/<wbr>20170206/130837fd/attachment.<wbr>html</a><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: image002.png<br>
Type: image/png<br>
Size: 15253 bytes<br>
Desc: image002.png<br>
Url : <a href="http://www.edulists.com.au/pipermail/sofdev/attachments/20170206/130837fd/image002.png" rel="noreferrer" target="_blank">http://www.edulists.com.au/<wbr>pipermail/sofdev/attachments/<wbr>20170206/130837fd/image002.png</a><br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<br>
sofdev mailing list<br>
<a href="mailto:sofdev@edulists.com.au">sofdev@edulists.com.au</a><br>
<a href="http://www.edulists.com.au/mailman/listinfo/sofdev" rel="noreferrer" target="_blank">http://www.edulists.com.au/<wbr>mailman/listinfo/sofdev</a><br>
<br>
<br>
End of sofdev Digest, Vol 143, Issue 5<br>
******************************<wbr>********<br>
</blockquote></div><br></div>

<br>
This email message does not represent the view of St Kevins College, is intended only for the addressee(s) and contains information that may be confidential and/or copyright. If you are not the intended recipient please notify the sender by reply email and immediately delete this email. Use, disclosure or reproduction of this email by anyone other than the intended recipient(s) is strictly prohibited. No representation is made that this email or any attachments are free of viruses. Virus scanning is recommended and is the responsibility of the recipient.