1,857 Posted Topics
Re: 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; … | |
Re: 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: … | |
Re: Good to hear. Please remember to mark this solved thanks. | |
![]() | Re: 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 … ![]() |
Re: 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 … | |
Re: This [thread](http://www.daniweb.com/software-development/cpp/threads/425047/special-characters) might help | |
Re: 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); … | |
Re: 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 … | |
Re: 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 … | |
Re: This [article](http://msdn.microsoft.com/en-us/library/vstudio/system.drawing.drawing2d.matrix%28v=vs.100%29.aspx) might help | |
Re: 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 & … | |
Re: You can start by reading this [thread](http://www.daniweb.com/software-development/cpp/threads/431824/multiplying-matrices-using-pointers) | |
Re: 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` | |
Re: 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). | |
Re: 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 … | |
Re: If I'm not mistaken think of 1 as being same as when an input is High. | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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, … | |
Re: 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. | |
Re: 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 … | |
Re: 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) … | |
Re: 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 | |
Re: The problem might be your OS. Is your OS win7 or higher? Also which specific VS 2008 Express are you looking for? | |
Re: 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 | |
Re: 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: … | |
Re: 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, … | |
Re: 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. | |
Re: 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") … | |
Re: 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 | |
Re: 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 … | |
Re: 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) | |
Re: 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. | |
Re: 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. | |
Re: > 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. | |
Re: 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? | |
Re: 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 … | |
![]() | Re: 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. |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: > 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? | |
Re: 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. | |
Re: 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 … | |
Re: 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); } | |
Re: 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 … | |
Re: Right off the bat it looks like setText is expecting a string but you're passing an int | |
Re: 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. |
The End.