1,857 Posted Topics
Re: Are you sure you copied everything, did you overwrite the stub you already started, did you add the missing `End Class` statement at the end of your code? The code works fine as presented. Here it is all together: Public Class Form1 Inherits System.Windows.Forms.Form Public mylbl(26) As Label Private Sub … | |
Re: How are you storing the values for each student, that you want the averages of? | |
Re: Val doesn't recognize a ',' as part of a number and stops converting the string there. Thus you end up with 1+2+1 = 4. Try this instead: `TextBox4.Text = Format((Double.Parse(Textbox1.Text) + Double.Parse(Textbox2.Text) + Double.Parse(Textbox3.Text)), "Standard")` | |
Re: Here's a simple class that will print an image and a string to a page using the default printer. This may not do everything you want but it should be enough to show you what is required. You can use things like the image size to figure out what location … | |
Re: Hard to see what's wrong with your code, without actually seeing your code. | |
Re: Here's a thought. They have this wonderful new tool out now, it's called a `Search Engine`, and one of the best ones can be found [here](http://www.google.com) | |
Re: try For Each Value In Counts If Value = "Three" Then 'do something Else 'do something else End If Next | |
Re: perhaps something like this will work: protected void Page_Load(object sender, EventArgs e) { ShowColumns(); } protected void ShowColumns() { GridView1.Columns[0].Visible = RadioButtonList1.Items[0].Selected; GridView1.Columns[1].Visible = RadioButtonList1.Items[1].Selected; } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { ShowColumns(); } | |
Re: > i have initializing code in the begining for position in line 8 But in line 25 you need to assign it a value in order for the for loop to work Also your If statement in 30 shouldn't have a semi-colon. Your using a keyword to identify a variable, … | |
Re: Somtehing like this should work: Imports System.IO For Each Folder As String In Directory.GetDirectories("C:\Software Name\athletes") ListBox1.Items.Add(Folder.Split("\").Last) Next | |
Re: Code seems to work fine on my Code::Blocks 12.11 with Cygwin GCC compiler. | |
Re: What code have you got so far? | |
Re: If your string has a common delimiter, such as carriage return or period, you can use the Split function to split the string and store the pieces in an array. The Join function will then put the pieces back together with the delimiter. | |
Re: You'll have to show some code. | |
Re: 2 things come to mind, corrupt hard drive or corrupt RAM. | |
Re: Try this: static double computeVariance(ref double Variance, params int[] intValues) { int sum = 0; for (int n = 0; n < intValues.Length; n++) { sum += intValues[n]; } double avg = (double)(sum) / (double)(intValues.Length); double varSum = 0; for (int v = 0; v < intValues.Length; v++) { double … | |
Re: Perhaps handling the [MouseHover Event](http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.control.mousehover%28v=vs.100%29.aspx) will work | |
Re: A couple of things: use the boolean result of TryParse to test if there is a number being entered, Dim ValidTest as Boolean = Integer.TryParse(txtPoints.Text, intSearchPoints) If Not ValidTest Then MsgBox "Please Enter a Valid Number" Exit Sub End If use a for loop whenever you know the exact number … | |
| |
Re: There is a Read-Only Lines Property that is an array of strings that represent the lines in the textbox. You should be able to iterate through that, something like this: For I=0 to RichTextBox1.Lines.Length-1 'Access the specific line like this, RichTextBox1.Lines(I) 'And you can use the 'RichTextBox1.Lines(I).Contains("Some String")' method to … | |
Re: Try this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Assign_4 { class Program { static double MeanVar(ref double mean, params int[] intValues) { mean = intValues.Average(); double variance = 0; for (int i = 0; i < intValues.Length; i++) { variance += Math.Pow((intValues[i] - mean), 2); … | |
Re: you'll probably have to show the code you're using to get the string. | |
Re: Something like this might work for you: Dim Names As Dictionary(Of String, String) = New Dictionary(Of String, String) Dim open = OpenFileDialog1.FileName '// or you can specify the file path If IO.File.Exists(open) Then '// check if file exists Dim openFileLines() As String = IO.File.ReadAllLines(open) For Each line As String In … | |
Re: Main is your program's start point. Without that the program has no idea what to do first. Even if yopu want a certain routine to run first you have to call it from Main. Main is also where any parameters being passed are sent to. If you've been deleting things … | |
Re: There does appear to be a standard for biometric interfaces. Here's some articles about it: [Click Here](http://en.wikipedia.org/wiki/BioAPI) [Click Here](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_tc_browse.htm?commid=313770) [Click Here](http://biometrics.org/bc2012/presentations/Standards/Tilton1130-1155.pdf) [Click Here](http://msdn.microsoft.com/en-us/library/dd401509%28v=vs.85%29.aspx) | |
Re: The easiest might be to put the functions, subs you need into a code library(.dll). That way when you add it as a reference and import(vb)/using(C#) it you can use the routines in your new web app. This will simplify your learning curve somewhat. What I've found that works for … | |
Re: It appears to me the structure of the data being added to vector is different than the file. You're putting flevel(str[5]) before str[0], if you're not parsing the data to account for that it will give you screwy results, when you save it. Also it looks like the '#' at … | |
Re: You might be making it too complicated. You could simplify the rules and post them on the form(eg. only first and last name, only letters and numbers, only spaces, apostrophes, and dashes for punctuation), then simply use Split to separate the names and check if the name is in the … | |
Re: Then sort your list by amount, either as you add each one or later after it's complete. | |
Re: A [MaskedEdit Control](http://msdn.microsoft.com/en-us/library/aa733654%28v=VS.60%29.aspx) will restrict your input to numbers and you can specify a certain number of digits, and you can specify formatting as well. | |
Re: One way is, to start with a couple of loops to run through multiplication tables, say 2 to 16, 2 to 5 times. For each answer convert it to a different base as a string then add the values of each digit together, and compare the result to the multiplier. | |
Re: You could use a third array to hold the lines of strings. For each line in the string array .Split()[0] gets parsed to an int and put in array1, and .Split()[1] gets parsed as an int and put into array2. Here's a link to the [C# Programming Guide](http://msdn.microsoft.com/en-us/library/67ef8sbd%28v=VS.80%29.aspx) When you've … | |
Re: try this: protected void btnDeleteFromListBox_Click1(object sender, EventArgs e) { GridViewRow row = GridView1.SelectedRow; GridView1.Rows.Remove(row); } | |
Re: In both Visual C++ 2010 Express and Code::Blocks with the Cygwin GCC compiler, using,`#include <windows.h>` works fine. | |
Re: It should work if you change all your `Or`'s to `And`s(i.e `If Val(Text10.Text) <= 100 And Val(Text10.Text) >= 97 Then`). Altenatively you might find this quite a bit simpler: Dim Score As Integer Score = Val(Text10.Text) If Score <= 100 Then If Score >= 97 Then Text11.Text = 1 ElseIf … | |
Re: In VB6 you can call the event handler the same as any sub, just use `Command1_Click` in the Click handler for Command2. It's probably cleaner to make the code in Command1 a separate sub routine or function and call it from each button. If you decide to change things down … | |
Re: Use a [Try-Catch](http://msdn.microsoft.com/en-us/library/vstudio/fk6t46tz%28v=vs.100%29.aspx) block | |
Re: Use a [Try-Catch](http://msdn.microsoft.com/en-us/library/vstudio/fk6t46tz%28v=vs.100%29.aspx) block | |
Re: try this: Dim NewItem As ToolStripMenuItem = New ToolStripMenuItem NewItem.Text = Line AddHandler NewItem.Click, AddressOf NewItem_Click ContextMenuStrip1.Items.Add(NewItem) | |
Re: Try this [Click Here](http://msdn.microsoft.com/en-us/library/67ef8sbd%28v=VS.80%29.aspx). Use the examples you'll find in there to create your code, and when you have a problem getting your code to work then let us know | |
Re: shouldn't ` cout << numbers << " ";` be ` cout << numbers[i] << " ";`? | |
Re: At iteration 1861 you surpass the max for a signed long and it starts returning negative values. Try using `ulong a=i*i*i/2-3*i*i/2+3*i-1;`. | |
Re: This [post](http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/45ba284f-d95c-44c6-b250-f347c0916b14/), might help. | |
| |
Re: if newItem is the structure your passing you could make your dictionary of that type, then add newItem directly to the dictionary. something like this might work: Dictionary<String, Item> dic = new Dictionary<String, Item>(); public void addItem(Item newItem) { dic.Add(newItem.getItemName(), newItem); } public void listItemInfo(String itemName) { Console.Write("Name: {0}\n", dic[itemName].getItemName()); … | |
Re: try this, Add the event handler when you create the control: for (int NumberofPictureBoxes = 0; NumberofPictureBoxes < NumberOfDirectories; NumberofPictureBoxes++) { PictureBox picture = new PictureBox { Name = "" + Guid.NewGuid(), Size = new Size(150, 150), Location = new Point(NumberofPictureBoxes * 152, 1), SizeMode = PictureBoxSizeMode.StretchImage, Image = Image.FromFile(ListOfPictures[NumberofPictureBoxes].ToString() … | |
Re: You'll have to show more code than that and explain a little better. That code first of all has nothing to do with clicking a button, and second of all doesn't do anything. | |
Here's a simple wrapper for printing text. Built as a class library, this can be used in any .net application. This has automatic word wrapping. I figured that using the new constructor to accept different parameters would easily allow for printing different documents with different settings. I included Name, Font, … |
The End.