1,857 Posted Topics

Member Avatar for Lp_baez
Member Avatar for Lp_baez

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; …

Member Avatar for David W
0
2K
Member Avatar for frontier6444

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 …

Member Avatar for tinstaafl
0
138
Member Avatar for kiail

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 …

Member Avatar for tinstaafl
0
196
Member Avatar for Fangling

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.

Member Avatar for Fangling
0
209
Member Avatar for waqas.zafar.125

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 …

Member Avatar for David W
0
209
Member Avatar for yagelnnn1

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

Member Avatar for yagelnnn1
0
192
Member Avatar for Shodow
Member Avatar for ashking

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 …

Member Avatar for ashking
0
156
Member Avatar for ??!!

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: …

Member Avatar for tinstaafl
-1
349
Member Avatar for hardus

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 …

Member Avatar for tinstaafl
0
727
Member Avatar for yuvjeeth
Member Avatar for Sadun89

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.

Member Avatar for tinstaafl
0
107
Member Avatar for lavanya uppala

> 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 …

Member Avatar for tinstaafl
0
333
Member Avatar for kamilacbe

> 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.

Member Avatar for tinstaafl
0
265
Member Avatar for toxicandy

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 …

Member Avatar for tinstaafl
0
280
Member Avatar for major_lost

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 …

Member Avatar for major_lost
0
308
Member Avatar for laurel.jackson.12

> 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?

Member Avatar for laurel.jackson.12
0
302
Member Avatar for khorght

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.

Member Avatar for Nidal_1
0
921
Member Avatar for LeNenne

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.

Member Avatar for bonzo2008
0
200
Member Avatar for patrick.weaver.161

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.

Member Avatar for patrick.weaver.161
0
264
Member Avatar for mara.pradia

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;

Member Avatar for tinstaafl
0
137
Member Avatar for ogsirus

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 …

Member Avatar for ogsirus
0
497
Member Avatar for IsaacMessi10

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.

Member Avatar for IsaacMessi10
0
162
Member Avatar for laurel.jackson.12

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 …

Member Avatar for tinstaafl
0
149
Member Avatar for 2384443

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; }

Member Avatar for richieking
0
141
Member Avatar for soche123

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 …

Member Avatar for tinstaafl
0
707
Member Avatar for razinkac

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.

Member Avatar for tinstaafl
0
174
Member Avatar for Aman.jen

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.

Member Avatar for artemix22
0
147
Member Avatar for dirtydit27

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; …

Member Avatar for tinstaafl
0
267
Member Avatar for BATCHOii.KO

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

Member Avatar for tinstaafl
0
107
Member Avatar for rdprecure

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.

Member Avatar for tinstaafl
0
367
Member Avatar for taolas

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.

Member Avatar for GeekPlease
0
336
Member Avatar for marcelopb90

[Click Here](http://www.daniweb.com/software-development/cpp/threads/437164/pi-approximation-with-taylor-series)

Member Avatar for tinstaafl
0
77
Member Avatar for MasterHacker110

> 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 …

Member Avatar for MasterHacker110
0
202
Member Avatar for kiail

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); } …

Member Avatar for kiail
0
248
Member Avatar for reza_m_n_65

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?

Member Avatar for tinstaafl
0
127
Member Avatar for IsaacMessi10

This [page](http://dotnetrix.co.uk/tabcontrol.htm) has source code for custom tab control and more links

Member Avatar for IsaacMessi10
0
476
Member Avatar for soche123

> 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 …

Member Avatar for tinstaafl
0
119
Member Avatar for jemartalaban_1
Member Avatar for Eternal Newbie

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 …

Member Avatar for Eternal Newbie
0
3K
Member Avatar for nathan.pavlovsky

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)`

Member Avatar for gusano79
0
369
Member Avatar for ron117
Member Avatar for ron117
0
288
Member Avatar for modaresi

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 …

Member Avatar for modaresi
0
533
Member Avatar for ogsirus

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 …

Member Avatar for ogsirus
0
211
Member Avatar for Learner010

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 …

Member Avatar for Learner010
0
414
Member Avatar for roybillstrom

[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.

Member Avatar for roybillstrom
0
93
Member Avatar for Abel21

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.

Member Avatar for Abel21
0
198
Member Avatar for iFrolox

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.

Member Avatar for iFrolox
0
180
Member Avatar for Abhinisha

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)

Member Avatar for NathanOliver
0
213

The End.