1,857 Posted Topics
Re: Not sure exactly what was causing the problem. But caling it again in the default case is redundant. Encasing the switch block in a while loop and only calling cin once per loop will solve the problem. Something like this: #include <iostream> using namespace std; int main() { int difficulty; … | |
Re: First off you're in the wrong forum. You should be in VB.Net. If you flag it I think an admin can move it for you. You'll probably have to access the MRU list through the [Registry Class](http://msdn.microsoft.com/en-us/library/vstudio/microsoft.win32.registry%28v=vs.100%29.aspx). Here's a [Code Sample](http://www.codeproject.com/Articles/3636/Add-Most-Recently-Used-Files-MRU-List-to-Windows-A) that is written in C# but the LoadMRU method … | |
Re: You might want to look at the ListView control. The Items collection will hold all your data(Item is the name and 2 subitems address and type), but when you choose the List view option only each item is displayed and none of the subitems. A class would certainly help in … | |
Re: You could put your data into a datatable. From there you can iterate through the rows and re-order the data and add it to another control. | |
Re: What's wrong with the code you've already got? The only problems I can see is possibly formatting the output with a '\t' at the start of the players lines. One suggestion I could make is, instead having the output direct from your class, have a ToString method instead and leave … | |
Re: I would suggest using a numericupdown control, as that will eliminate having to validate the users input. It would be used, in a buttons click event handler, something like this: Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click For I = 1 To NumericUpDown1.Value ComboBox1.Items.Add(I) Next End Sub | |
Re: Use the PrintForm control from the VisualBasic PowerPack. | |
Re: Since you're already reading the whole file into memory, you can use the Split method to create an array of strings, then iterate through the array to add each item to your listbox. depending on the exact format of your data you may need to tweak things but the basic … | |
Re: With 2 class methods timeinseconds and secondstotime your operators code(+ ==) becomes much easier. This way you should be able to use the == operator to test for equality. You can also use the secondstotime in your constructor to accept only seconds as the parameter. Something like this might help: … | |
Re: You won't need to store the images in an array. all you need is the path to each image file, and store that in a vector, which gives you much more options adding, removing, replacing, etc. You could even go the extra step of having a class that stores the … | |
Re: try `Combobox1.Text = webBrowser1.Url.ToString()` | |
Re: Use the same CheckedChanged event handler for the checkboxes then with a class level list of checkboxes, add or remove the checkbox to/from the list based on whether the checkbox is checked or not. | |
Re: > and buttons of text trough character bit map A little stumped myself, please explain better. However if you have to break a string down by its characters. Every string is a charater array. you only need to specify the index of the character you want to access. For instance … | |
Re: > mooo as it is diff installation can only be accesed wit its own command prompt. You could use the Process Class to call the program. You can even redirect standard in and out to interact directly with it. | |
Re: Unless your system is going to have to handle millions of items I would suggest using a list and a custom structure to hold the data. Now you have access to searching, sorting, inserting, and deleting. The code to load and save the list is very straight forward. From here … | |
Re: Here's a way to disable the other control when text is entered and switch back if the text is deleted: Private Sub TextBox2_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox2.TextChanged If TextBox2.Text = "" Then TextBox2.Enabled = False Else TextBox2.Enabled = True End If ComboBox1.Enabled = Not TextBox2.Enabled End Sub … | |
Re: > I need to mulitply but I don't know how This,`(Diameter_ofcircle)* Pi * ( priceofrailingmaterial)`, seems to be ok. what problem are you having with multiplying? | |
Re: have you tried adding the .dll as an a reference add a using statment add the namespace to your app? That way intellisense can tell you where your synatax is wrong. | |
Re: Everything should convert straight over, except for DoCmd. DoCmd is part of the Office library. To do the same thing in VB6 is probably possible, but it's hard to remember that far back. | |
Re: Basically he's telling you the parameters of the sub routine. The path to the excel file and the name of the macro, in the excel sheet in that file , you want to run. Make sure you read his comment about imports in order to run his routine. | |
Re: Basically just use the `+` operator. int a = 1; int b = 2; int c = a + b; int d = 1 + 2; int e = a + 2; int f = 1 + b; | |
Re: You're code doesn't seem to match what you're trying to do. Your foreach loop declares the string file but you don't use it anywhere in the loop. > it tells me that it couldnt find the first file despite it has been moved already Your loop is using the same … | |
Re: If your custom buttons inherit from Windows.Forms.Button then use the Enabled property. It's a boolean. Set it to False to disable the button. If you also want it to disappear set the visible property to False. | |
Re: I found several things wrong in your SearchZip routine. It's easier to just to show you the corrected code: void searchZip() { string zipCode = ""; string cityName = ""; string searchFor = ""; //I set this to false. This way it only needs to change if a zip is … | |
Re: Help you with what? Is there a part that isn't working right? Are you getting compiler errors? These functions are redundant, pick one and use it. int sum(int s) { return s; } int sum(int x) { return x; } | |
Re: Here's some code for you. I modified your delete routine move the record to the empty part of the array. I added code throughout to use the size variable as the end of the records and to check for out of bounds conditions. I removed `i` from the global namespace … | |
Re: Firstly there's no question in your post. Merely a bunch of info. Secondly you quote an error but it appears to bear no relation to the code you've shown. | |
Re: I think your problem might be here: If dr.HasRows Then dr.Read() TB1.Text = (dr.Item("P_id")) TB2.Text = (dr.Item("P_Name")) End If This only reads one row. You'll probably need For Each or a While loop and use the .AppendText method of the TextBox's. | |
Re: You can declare objects of type Bill and Date and use the public members in your class. For instance: class Date { public: int year; string month; int day; int hour; int minute; Date() :year(1900), month("Jan."), day(1), hour(0), minute(0) { } }; class Bill { public: Date lastPayment; Date nextPayment; … | |
Re: in .net arrays, you have access to the First and Last methods. They also implement the Max and Min methods which work with any array of number values or values that can be transformed to numbers | |
Re: Using the curly braces indicates an array, but the Add method only accepts 1 item. I assume the mydatarow("LastName") is a subitem. Something like this should work: ListView1.Items.Add(mydatarow("FirstName").ToString).SubItems.Add(mydatarow("LastName").ToString) This is assuming of course that you've added atleast 2 columns to your listview. | |
Re: Here's a list of [sites](https://www.google.ca/search?q=vb6+tutorials&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a) with tutorials on VB6. | |
Re: [Click Here](http://www.daniweb.com/software-development/cpp/threads/437164/pi-approximation-with-taylor-series) | |
Re: > The program then reads the line from the file and converts the string into an int. It here where i get an error from the compiler. I'm pretty sure this will return the character codes for the characters not the integer values represented by the characters. The error might … | |
Re: Here's a simple Icomparable implementation for your class: public class Ages:IComparable { public string initials { get; set; } public int age { get; set; } public Ages(string pInitials, int pAge) { initials = pInitials; age = pAge; } public override string ToString() { return string.Format("{0} {1}", age, initials); } … | |
Re: Two things One - You should really use the Code Snippet, not discussion Thread for this. Two - Providing a link is fine but you should really post the code as well. Also what does your textbox do that a MaskedTextBox doesn't do? | |
Re: This [page](http://dotnetrix.co.uk/tabcontrol.htm) has source code for custom tab control and more links | |
Re: > how come compiler is displaying this problem even though I've declared the array. Mainly because you didn't spell it right. You missed the 'n'. Also in toBinary, `decimalToConvert` is undefined. This is one aread that VC++ really shines. Intellisense would have flagged that as you were typing it, making … | |
Re: I'm pretty sure the controls will be deleted with their parent. One option you have is to remove the controls from the parent control and place it in a different one or the form itself For Each c As Control in GroupBox1.Controls Me.Controls.Add(c) Next You may have to play with … | |
Re: It probably still won't do what you want. You probably want a start value of .05(5 percent), a limit of .10(10 percent) and an increment of .01(1 percent), `for (float rate=.05; rate<=.10;rate+=.01)` | |
Re: You can simulate a button click with code by using ` Button1.PerformClick` | |
Re: First of you really should consider using an IDE that will format your code. What you've submitted is very hard to read. Second here's the error I noticed. You declare `datalenth` and pass it to `readdata` routine. It's getting the value from the first record in your textfile. Which is … | |
Re: You might want to consider a TreeView which is made for that sort of thing. If I'm not mistaken the only way to do it in the listbox is to use spaces or VBTab to offset a line. Doing it with a listbox means you have to define your own … | |
Re: When you create the new button use the [Addhandler statement](http://msdn.microsoft.com/en-us/library/vstudio/7taxzxka%28v=vs.100%29.aspx) to add the a click handler to the button. It's ok for them to all point to the same handler. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Static x As Integer Dim btn As New … | |
Re: [How to: Enable a Batch Mode for Window Forms Applications (Visual Basic)](http://msdn.microsoft.com/en-us/library/vstudio/stws2269%28v=vs.100%29.aspx) the examples here should help you with what you want. | |
Re: In C# all controls in a form are private by default. You can change this by changing the modifier property of each control to public. | |
Re: In addition, if you switch to a datagridview with a datatable as datasource you can present your information and the datatable can read and write the information to and from an xml file. | |
Re: argc is an int representing the number of arguments in argv. argv is an array of pointers to the arguments the program expects. If you don't plan on using them they can be omitted. Here's a more involved [explanation](http://www.cplusplus.com/forum/beginner/5404/#msg23839) |
The End.