1,857 Posted Topics

Member Avatar for jose.a.rueda.5

This might help: #include<stdio.h> #include<conio.h> #include <ctype.h> using namespace std; void main() { int i,j; char n; printf("Enter the target letter: "); //get the target character scanf("%c",&n); //convert it to upper case n= toupper(n); //start the loop. Notice starting i at 65 eliminates the need for another char variable for(i=65; …

Member Avatar for tinstaafl
0
137
Member Avatar for Asotop

Try something like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Globalization; namespace TimeStampcs { class Program { static void Main(string[] args) { string line = "Maalinger: Node: 1 Dato og KL: 2013-05-03 14:10:37 Puls: 554 Blodtrykk: 376 Kroppstemperatur: 20 Respirasjonsrate: 20$"; string value = line.Substring(line.IndexOf("KL: …

Member Avatar for tinstaafl
0
252
Member Avatar for kyle.mace.35
Member Avatar for tinstaafl
0
119
Member Avatar for ChargrO

Here's a simple function for you, and a way to incorporate it into your code: Private Sub btnDisplayTotals_Click(sender As System.Object, e As System.EventArgs) Handles btnDisplayTotals.Click 'Validate the password first thing, then exit if it returns false If Not ValidPassword Then Exit Sub ' Variables for handing data Dim strIncomes2(3) As …

Member Avatar for ChargrO
0
199
Member Avatar for ChemE_Programma

First off make sure the name is unique. then declare it as public outside of any sub or function, then use it like any variable. A little trick I found helpful is include capitals in the variable name. that way when I'm coding, if the name doesn't change I typed …

Member Avatar for tinstaafl
0
260
Member Avatar for teo236

This [thread](http://www.daniweb.com/software-development/cpp/threads/425047/special-characters) might help

Member Avatar for tinstaafl
0
362
Member Avatar for lewashby

Here's some code you might find interesting. This routine will pad the input number with the required number of '0's to make the length divisible by 3: #include <iostream> #include <string> using namespace std; int main() { string input = ""; while(true) { cout <<"Enter number('Q' to quit): "; getline(cin,input); …

Member Avatar for tinstaafl
0
122
Member Avatar for gobiking

Here's your original code cleaned up: #include <iostream> #include <math.h> #include <string> using namespace std; int result,value; char sign; int main() { result = 0; do { cout<< "Current value is "<<result<<endl; cout<< "Please enter an operation +,-,*,/ <Press 'Q' to quit>"<<endl; cin>> sign; if(toupper(sign) == 'Q') break; cout<< "Input …

Member Avatar for Labdabeta
0
296
Member Avatar for 404notfound

Here's a simple sub, to use in your button click event handler, that will fill a datagridview from a .csv file. This sub accepts, the path of the file, the datagridview control, and an optional boolean, with a default value of false to use the first line as a header …

Member Avatar for tinstaafl
0
279
Member Avatar for Trench37716

This [article](http://msdn.microsoft.com/en-us/library/vstudio/system.drawing.drawing2d.matrix%28v=vs.100%29.aspx) might help

Member Avatar for tinstaafl
0
77
Member Avatar for savedlema

The output of that code won't show show in your app. It will be in the immediate window in Visual Studio. To see it in your form try something like this: Textbox1.Text += vbCrLf & vbCrLf & "STDOUT" & vbCrLf & vbCrLf & Out Textbox1.Text += vbCrLf & vbCrLf & …

Member Avatar for tinstaafl
0
4K
Member Avatar for mo7al

You can start by reading this [thread](http://www.daniweb.com/software-development/cpp/threads/431824/multiplying-matrices-using-pointers)

Member Avatar for tinstaafl
0
54
Member Avatar for pearl.kumar1

I assume you're using the printform control from the vb powerpack. Did you try setting the landscape setting to true? `PrintForm1.PrinterSettings.DefaultPageSettings.Landscape = True`

Member Avatar for tinstaafl
0
266
Member Avatar for taekiewzz

If you use the ShowDialog method, the execution stops until the form is closed. Take a look at this [thread](http://www.daniweb.com/software-development/csharp/threads/453734/pass-listbox-item-between-2-form#post1969288).

Member Avatar for taekiewzz
0
254
Member Avatar for Papa_Don

You could try something like this: PrinterId = myText.Split("|").Last `PrinterId` should contain everything in your string from the last `|` to the end, not including the '|'. If you need something a little more generic, here's a simple little function that will return the number of characters from either the …

Member Avatar for Papa_Don
0
8K
Member Avatar for silvercats
Member Avatar for Assembly Guy
0
269
Member Avatar for sakura.cristiana

See if this [article](http://msdn.microsoft.com/en-us/library/77d8yct7.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) will help.

Member Avatar for tinstaafl
0
35
Member Avatar for taekiewzz

In Form1 make the listbox modifiers property public. Make the continue button the Accept Button. Make the formborderstyle fixeddialog. Make StartPosition CentreParent. Use this code in Form2: Form1 NewForm = new Form1(); NewForm.ShowDialog(); listBox1.Items.Clear(); listBox1.Items.AddRange(NewForm.listBox1.Items); Showdialog makes form1 tied to form2, until it is closed. When you click the continue …

Member Avatar for tinstaafl
0
2K
Member Avatar for blaze007

OP's probably referring to having an array of int's not string's. something like this might work: //declare list of ints List<int> test = new List<int>(); //build file System.IO.StreamWriter sw = new System.IO.StreamWriter("Test.txt"); sw.WriteLine("1,2,3,4,5"); sw.WriteLine("6,7,8,9,0"); sw.Close(); //initiate reading from the file System.IO.StreamReader sr = new System.IO.StreamReader("Test.txt"); //loop through each line of …

Member Avatar for ddanbe
0
341
Member Avatar for Rabastan

If your other form is called Form2 then declare a new form of type Form2,`Dim NewForm As New Form2`,now you have full access to any of the controls in Form2, `NewForm.TextBox1.Text = "some string"`. When that is all done just call the Show method, unless you need a DialogResult returned, …

Member Avatar for Begginnerdev
0
171
Member Avatar for joeydal

One thing I see is you're adding the input name directly to the array , before you search the array for the name. I would suggest using a simple menu, with the options Find a friend, add a friend, remove a friend, display friends, and end the program.

Member Avatar for tinstaafl
0
190
Member Avatar for pc20912

When you add the textboxes to the tabpage, the tabpage automatically creates an array for them, the same for the tabpages. Since you would have to use a loop to add them,a separate array in this case would probably be redundant. Here's some code that adds the textboxes and the …

Member Avatar for tinstaafl
0
240
Member Avatar for renzlo

Assuming that both files are guaranteed to be the same number of lines, something like this should work: Dim testab As New StreamWriter("C:\testab.csv") Dim testa As New StreamReader("C:\testa.csv") Dim testb As New StreamReader("C:\testb.csv") While Not testa.EndOfStream Or Not testb.EndOfStream Dim StringToWrite As String = testa.ReadLine + "," + testb.ReadLine testab.WriteLine(StringToWrite) …

Member Avatar for renzlo
0
1K
Member Avatar for Zulu79

It looks like you're reading the file and storing the bytes in `data`. But, no where is there any code that tries to send `data` to the database

Member Avatar for tinstaafl
0
140
Member Avatar for Sneaky Pete

The problem might be your OS. Is your OS win7 or higher? Also which specific VS 2008 Express are you looking for?

Member Avatar for tinstaafl
0
489
Member Avatar for GeoEqual

It would appear to me OPTION is setting a series of flags. This [article](http://msdn.microsoft.com/en-us/library/vstudio/ms254978.aspx) might help

Member Avatar for imBaCodes
0
197
Member Avatar for SLMQC

You're accessing intCount outisde the for loop. Thus it will always point to 12, which will throw the IndexOutOfRangeException , cause your array is only indexed to 11. This is also why you always get December when you use intcount-1 Something like this should be closer to what you want: …

Member Avatar for SLMQC
0
421
Member Avatar for amvx86

Here's an srticle on [Calling Windows API's in VB.net](http://msdn.microsoft.com/en-us/library/vstudio/ms172890%28v=vs.100%29.aspx). It includes links to other articles as well. a trick I found useful for searching in MSDN is add, vb vs.100, to your search terms. this will filter the results specifically for vb 2010. Also make use of the preset filters, …

Member Avatar for tinstaafl
0
387
Member Avatar for sumitrapaul123

You could use the button to show a dialog form with textboxes to get the info, validate the info to make sure it was entered right, then declare a new listviewitem, add the info from the dialog and add it to the listview item collection.

Member Avatar for tinstaafl
0
3K
Member Avatar for Aerigon

To show in a textbox instead of messagebox try this: Dim duration As Integer = Convert.ToInt32(Math.Ceiling(Math.Abs(dtArrive.Subtract(dtDepart).TotalDays))) + 1 Dim price As Integer = duration * pricePerNight Dim sNumberOfDays As String = duration.ToString() Dim sArrivalDate As String = dtArrive.ToString("d") Dim sDeparture As String = dtDepart.ToString("d") Dim sTotalPrice As String = price.ToString("C2") …

Member Avatar for tinstaafl
0
290
Member Avatar for Papa_Don

try something like this: Public Sub cbxEditLocation_Click(sender As Object, e As System.EventArgs) Handles cbxEditLocation.Click cbxDeleteLocation.Checked = False cbxNewEntry.Checked = False cbxEditLocation.Checked = True sTask = 1 Dim NewPLEdit as New Popup_LocationEdit NewPLEdit.ShowDialog() End Sub

Member Avatar for Papa_Don
0
749
Member Avatar for pc20912

The tab pages are 0 indexed, you add controls to them the same as you add to a form. Either directly in the designer, just drop them onto the tabpage and they are added to that page, or in code, set up the control, then use `TabControl1.TabPages(0).Controls.Add` To access the …

Member Avatar for tinstaafl
0
321
Member Avatar for mitchell.palmer2

The Left function you're looking for isn't there anymore, but each string has a substring method, that basically combines the functionality of Left, Right and Mid from VB6, that will do the job: codefunction=intxtbox.Substring(0, 4)

Member Avatar for tinstaafl
0
172
Member Avatar for rgilmore

Your logic seems Ok, but it's hard to tell for sure without a sample of the file. One thing, it appears that CurrentTest is a control, possibley a textbox or a listbox. Each of those contains the lines in a collection, the StringReader is somewhat redundant.

Member Avatar for tinstaafl
0
302
Member Avatar for new_developer

How about this a class called staff with name, id,salary, dateofjoining,qualification. a class called university with Vector<staff> AllStaff, and function addstaff and removestaff, you could also include functions for scheduling, hours worked, etc.

Member Avatar for tinstaafl
0
132
Member Avatar for Desi Winda

> how to generate a large prime numbers in vb > using fermat algorithm. Actually using fermat algorithm, all you get is best guesses, with a high degree of probability of being prime.

Member Avatar for tinstaafl
-1
136
Member Avatar for imBaCodes

Is the pdf printer driver for saving files or printing? What library are you using for pdf's? What pdf printer driver are you using?

Member Avatar for imBaCodes
1
336
Member Avatar for on93

Yes the indexes of the images will change. If you want the indexes to remain the same, you could make a blank image and just replace instead of remove. Even better is use the tag property to identify your images. Unless you have thousands of images, it wouldn't take a …

Member Avatar for tinstaafl
0
176
Member Avatar for DyO1

If you import the images to Resources(Resources tab in project properties) you can access them through My.Resources. This way the images are automatically included in your application, and your app can access them at will.

Member Avatar for tinstaafl
0
192
Member Avatar for peymankop

There are a couple of options, the simplest is probably `Thread.Sleep`. You might find it easier to write and read your code if you cast the control to the type you want once as a new control, then use the properties of that control, rather than casting it each time …

Member Avatar for tinstaafl
0
156
Member Avatar for ppstyle

Have you thought about using the richtextbox itself? You can load the file directly, and access the rtf code as well. If the picture is embedded the rtf code should show it as a string of bytes.

Member Avatar for tinstaafl
0
248
Member Avatar for robnederland

The [system.IO namespace](http://msdn.microsoft.com/en-us/library/vstudio/29kt2zfk%28v=vs.100%29.aspx) includes several different ways this can be accomplished. Basically you want to read the file one line at a time and look for "SITUATIONAL" in the line then act when you find it. There is the option to read the whole file into memory, but if the …

Member Avatar for G_Waddell
0
1K
Member Avatar for ppstyle
Member Avatar for game4tress

> share it among several clients Do you mean sharing the data? Having several clients running the same app doing calculations? Are the capabilities you want already present in your app, but you need to leverage Azure?

Member Avatar for game4tress
0
199
Member Avatar for Tarwit

It seems to me the 8 digit numbers are just headers not data. It sounds to me you want add the extra rows to the shorter column to make the rows the same as the longer column. Perhaps we should see some of your code to get a better understanding.

Member Avatar for TnTinMN
0
289
Member Avatar for marram

A simple way for a windows form. Create the form(`LoginForm`) with the textboxes, set the password mask on one of them, and labels you want, an OK button and a Cancel button. In the `LoginForm` properties set the Accept Button and Cancel Button properties appropriately. Double-click the OK button to …

Member Avatar for waqassilat
0
155
Member Avatar for nik701a

Here's one way to add a shape: private void button1_Click(object sender, RoutedEventArgs e) { Ellipse NewEllipse = new Ellipse(); NewEllipse.Name = "newellipse"; NewEllipse.Height = 100; NewEllipse.Width = 200; NewEllipse.Stroke = Brushes.Black; NewEllipse.Fill = Brushes.DarkRed; canvas1.Children.Add(NewEllipse); }

Member Avatar for nik701a
0
3K
Member Avatar for xanawa

Something like this will work: string hexstring = ""; foreach (char c in textBox1.Text) { hexstring += String.Format("{0:X}", (int)c); } hexstring = hexstring.Insert(8, "-"); hexstring = hexstring.Insert(13, "-"); hexstring = hexstring.Insert(18, "-"); hexstring = hexstring.Insert(23, "-"); Guid tokenguid = new Guid(hexstring); textBox3.Text = tokenguid.ToString(); Of course this means your original …

Member Avatar for Ketsuekiame
0
265
Member Avatar for annitaz

Right off the bat it looks like setText is expecting a string but you're passing an int

Member Avatar for tinstaafl
0
335
Member Avatar for Papa_Don

The controls have a tabindex property. with this you can regulate what order the tab/shift-tab navigate through the controls. There's also a tabstop property to regulate which controls can be tabbed to.

Member Avatar for Maligui
0
565

The End.