1,857 Posted Topics
Re: Here's a place to start [Click Here](http://www.daniweb.com/software-development/cpp/threads/148432/how-do-i-count-words-in-a-string-properly) | |
Re: If you use a list of strings and the readalllines and the writealllines methods, you can read manipulate and overwrite the file without any extra coding. Here's one way of doing it: Imports System.IO Imports System Imports System.Linq Imports System.Collections.Generic Imports System.ComponentModel Imports System.Drawing Imports System.Text Imports System.Windows.Forms Public Class … | |
Re: Since you're coding a console app, use console.readline and your input will be a string. from there simply validate that each character is a digit, and a for loop can easily parse the string into the values you want. | |
Re: One caveat to bear in mind with the algorithm you're using. If any one of the sides is half of the perimeter the algorithm will return 0. For Example 10, 20 ,30, s will equal 30, when you subtract c from s you end up with 0, which makes the … | |
Re: First off you seem to want to declare some chars, but you're not giving any of them a name. Secondly the cout statement on line 12 is missing the statement terminator `;` Thirdly none of the cout's will execute unless the number entered is exactly one of those grades, except … | |
Re: FillRectangle expects a Brush not a Color, but if you instantiate a Brush derivative(i.e. SolidBrush), you can set the color property using the Color.FromARGB overload that accepts just the RGB values and assume and Alpaha value of 255 (fully opaque). Private Sub ListBox10_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) … | |
Re: Have you tried running just the compiled code without the VS2010 running? I've heard some people have trouble running VS2010 on Win7/8. I think some have had better luck using the XP Compatiblity Mode. | |
Re: there are several ways to do that. Hard code ths list as data inside the program, use progam settings, external file, database, have a webite or ftp site with a file, are just some of the ways this could be accomplished. To find out for sure you'd probably have to … | |
Re: The split function will do the job: Dim MyString As String = "ajasasaj$testing%878788%%$lkshhajsjah" 'This splits a the string, by the "$", into an array Dim MySplitString() As String = MyString.Split("$") 'This gives the number of records Dim Cnt As Integer = MySplitString.Count 'This joins the string back together without the … | |
Re: something like this might work: for (double i = 5; i <= 23; i += 1.5) { textBox1.AppendText(i.ToString() + "\n"); } the output is: [0]: "5" [1]: "6.5" [2]: "8" [3]: "9.5" [4]: "11" [5]: "12.5" [6]: "14" [7]: "15.5" [8]: "17" [9]: "18.5" [10]: "20" [11]: "21.5" [12]: "23" … | |
Re: Your code is close to correct, you were trying to access the groupbox just by it's name instead of as an object: foreach (GroupBox sgrpBox in batch_creation.ActiveForm.Controls.OfType<GroupBox>()) { if (sgrpBox.Name.Substring(0, 4).Equals("gBox")) { foreach (ComboBox comboBox in sgrBox.Controls.OfType<ComboBox>()) {....... When you cast the objects in the foreach loop as the specific … | |
Re: Perhaps a sample of your text file will help to clarify what you need. | |
Re: first off, you declared i as string, then you assign it an integer and compare it to an integer. Keeping Option Explicit On, helps to catch this kind of mismatch right away. Secondly, you've started a while loop based on the value of i, but you never change i so … | |
Re: Basically all your message does is say something went wrong. Using the message directly from `ex` will give you a better idea of exactly want went wrong. Change the line to `MessageBox.Show(ex)`. Then make note of the exact message wording. That will determine how you proceed from there. Or better … | |
Re: As with all software, when it no longer does everything that you need it to do, upgrade. The main caveat to that is if you're building secure applications and/or deploying for enterprise you'll probably want to stay current with the latest technologies. | |
Re: Also the control will have a Parent property if you need to know which groupbox it is in. If your controls are added at design time, a couple of nested for each loops will allow you to add the same handler to each combobox. foreach GroupBox gb in Me.Controls.OfType<GroupBox>() { … | |
Re: it might be better to use the oftype property in your foreach loop; public void ClearTextBoxes(Control control) { foreach (TextBox c in control.Controls.OfType<TextBox>()) { c.Clear(); } } | |
Re: >[The types in System.Data.OracleClient are deprecated. The types are supported in version 4 of the .NET Framework but will be removed in a future release. Microsoft recommends that you use a third-party Oracle provider.](http://msdn.microsoft.com/en-us/library/vstudio/77d8yct7%28v=vs.100%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) However that page does discuss using it. | |
Re: You can copy and paste the appropriate code snippet here, just click the 'Code' button, paste it in, and the code comes out nicely indented the same as Visual Studio. Add an explanation of what the code is not doing right, any error messages, and the relevant line throwing the … | |
Re: The first step is represent every type you want to convert as Tola. Doing this you get a table like this: Grams = 12.5 Tola = 1 Masha = 12 Ratti = 20 form this a simple formula will convert from any type to any type. Convert to quantity to … | |
Re: Where are the panels and where do you want to access them from? | |
Re: It seems to me you're using the class without instantiating an instance of it. Perhaps something like this,`Data NewData;`, will help. Then use `NewData.loadDB();` to call the methods. Also just noticed, your datasource string seems to have an extra `'` in it. | |
Re: You'll have to show how you're finding the mouse position. Most likely the rectangle holding the image is much bigger than the image. You could try resizing the rectangle, or calculating the center of the image and use that as an offset. One way to make the character appear to … | |
Re: [realloc](http://www.cplusplus.com/reference/cstdlib/realloc/?kw=realloc) void* realloc (void* ptr, size_t size); Reallocate memory block Changes the size of the memory block pointed to by ptr. [free](http://www.cplusplus.com/reference/cstdlib/free/) void free (void* ptr); Deallocate memory block A block of memory previously allocated by a call to malloc, calloc or realloc is deallocated, making it available again for … | |
Re: the button should have an enabled property just set it to false | |
Re: If you create a webbrowser control, then create an htmldocument from a URL loaded in that control, you now have acces to all the elements in the web page and can access any values in those elements, even get the outer html code for any specific element. Public Class Form1 … | |
Re: > How do I return the value of a custom property in Word 2007 using VBA? Where is the property? And where do you need to put the value? What code have you got? | |
Re: Where's your code that fills the comboboxes? What are you using for a data source? If it's a file, we need to see a sample of that. If it's a database we need to see the table structure and how your connecting and querying. | |
Re: I would suggest using a custom structure(StoreItem) for each item chosen with name, quantity, price per each, total cost, and discount as properties of the structure. You might have a method to adjust discount terms Then another structure(Order) that containbs a list of StoreItem, subtotal, tax, net total as properties. … | |
Re: Here's an article on the [HTML Document Class](http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.htmldocument%28v=vs.100%29.aspx) | |
Re: Your first place to start is use a more uptodate language. What you want to do is possible with the express versions of Visual Studio. Using VB6 is like chaining a steel ball to your ankle before you run a marathon, you've lost before you even start. Next you should … | |
Re: Change your arrays to `double`, `double test1[size], test2[size];` | |
Re: The pdf is probably an image of text. OCR or transcribing by hand are probably your only options. In this case it will probably be much faster to just transcribe it into notepad then copy and paste it here. | |
Re: Your code was clos as written. A couple of things, you're incrementing a local variable in primecount, then displaying different variable in main. Also you're incrementing total in the wrong place, you need it after the end of the for loop, and just before you clear counter. Here's some adjusted … | |
Re: Basically what happens is you end up with several copies of the function operating until the last one ends then they back up until the first one ends. so the for loops don't end when the new function is called, their execution is basically suspended until the call is returned. … | |
Re: I'm pretty sure there is no native class or api for that. You'll probably have to open the file in binary mode and read, parse and write the data directly. | |
Re: Yopu might have to be a bit more specific on how you want to compare the arrays. If the arrays have the same values will they be in the same order? If the arrays are different sizes how do you want to handle that? if arrayA has 1,2,5,10 and arrayB … | |
Re: Here's some code to look at: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication12 { class Program { static void Main(string[] args) { int bbase = 0, playerNo = 0, dataentryerror = 0; int[,] PlayersStats = new int[12, 5]; while(true) { bool goodentry =false; while (!goodentry) { Console.Write("Enter … | |
Re: Something like this should work: MouseDown -= OnMouseDown; DoubleClick -= OnDoubleClick; | |
Re: Or do you want the second form to open inside the first form? If you start a new project using the application wizard and set it for Multiple document Interface, you get a working sample on how to set one up. | |
Re: Take a look at this [thread](http://www.daniweb.com/software-development/vbnet/threads/118869/search-in-datagrid) | |
Re: If you add a reference(Project menu) to Microsoft Scripting Runtime, you'll have access to the FilesystemObject which has a FileExists method. Using that should give you what you want. btw joshl_1995 that's .net code | |
Re: This [MSDN Article](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.datasource.aspx) should help. Basically it appears you create a table with the data to populate the comboboxes, by querying the database, and set the comboboxcolumn datasource to the table. | |
Re: You have several options, the [Mid Statememnt](http://msdn.microsoft.com/en-us/library/aa266166%28v=vs.60%29.aspx) will replace a string within a string with characters from another string. You can use the [InStr function](http://msdn.microsoft.com/en-us/library/aa445031%28v=vs.60%29.aspx) to find the index of the string you want to replace. The [Len Function](http://msdn.microsoft.com/en-us/library/aa445063%28v=vs.60%29.aspx) can be used to find the length of a string. | |
Re: Put the event handler in your class using the handles clause. Private Overloads Sub Me_LostFocusByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus In your form have another event handler without the handles clause, use the addhandler statement instead. The one with the handles clause should run first AddHandler … | |
Re: a function overload means you can accept different sets of parameters for basically the same function. an operator overload means you define how the operators(+,-, ++, --, etc.) work for your class | |
Re: Here's one way to do this. Make your own control: Public Class White_ReadOnly Inherits TextBox Public Sub New() [ReadOnly] = True BackColor = Color.White End Sub End Class With this you can add new ones dynamically, by adding this class to the end of your form code, and declaring it … | |
Re: How is the login form being opened? what kind of information do you need to pass? | |
Re: Your problem could be here: `sourcefile1 = File2.Path & "\min"` your using min as a string constant isntead of a variable. Try this: `sourcefile1 = File2.Path & "\" & min` | |
Re: I don't see anything in that code that would cause that exception. How are you deploying the app? |
The End.