Getting Position Of Strings?
Mar 26, 2009how i can find the position of a letter(let's say in a textbox of 50 letters) so then when its position is found i can change that letter by the position?
View 6 Replieshow i can find the position of a letter(let's say in a textbox of 50 letters) so then when its position is found i can change that letter by the position?
View 6 RepliesSay I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?
View 2 RepliesI have looking for a tutorial or class that demonstrates more than a trivial example of saving a windows position on closing. The ones I have found don't seem to work on all systems because of:
1. Multiple monitors. (and resolution between those monitors)
2. Toolbar size and position (toolbar is only on the primary monitor, well sometimes)
3. Sometimes the programs dont open on the right monitor they were closed on.
Is there an extensive class or tutorial on all the stuff a programmer needs to get right to have a window size and position persisted between executions?
I am using the following code to populate data in Textbox1:
[Code]...
I have few functions assigned in TextBox1_TextChanged event. The problem i am facing is this event is fired twice, once after the Fill command and another after the Position command whereas i want the event to fire only once after the Position command. What should i do?
I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.
View 39 RepliesI have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.
Here is the method I wrote:
Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))
[code].....
It works, but I would rather use built in functions whenever possible.
I'm migrating from VB6 to VB.NET, in hence my questions below:
I have to write a function that returns array of strings.
How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.
Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?
I also have a function that returns ALL tiles on the map and they're X, Y position. How could I find out which one is closest to the position I specify? I can't figure out how to go about it. how to implement it with this. Heres a MADE UP example if what I'm trying to do:
Dim MyPosition as New Position()
MyPosition.X = 400
MyPosition.Y = 400
Dim tList as New List(Of Tile) = MyMap.GetTiles
Now, I can already do the stuff above, but what I need to make is something like this:
tList.GetTileClosestToPosition(MyPosition)
I have been looking for examples to find the string between two strings. This top one works fine;
Public Sub ReadData(ByRef keywordStart As String, ByRef keywordEnd As String, ByVal filename As String)
Using reader = New StreamReader(filename)
[Code].....
Now the first one is fine - Ext_Volume is result of the string between the strings <Volume> and </Volume>. <Volume> and </Volume> are unique so this is straight forward.
However the second one - "^FDExp:" is unique, but "^FS" is not unique. There are occurances of "^FS" before and after "^FDExp:".
How do I get the string to search AFTER the occurrence, not before etc?
Dim str As String
Dim str2 As Array
str = "blabla duhduh"
str2 = str.Split(" ")
Say the string is something like
bla bla bla bla (cat) bladfdskdfd dsgdsdksf (dog)
dfdshfdskdskfsdfkhsdf sdkfhdsfkdf (kathy) fdsfhdskfhdsfkd (doggy)
I want a generic.list (of string) containing
cat
dog
kathy
doggy
How to do that with regular expression in vb.net
Later I want to do something more complicated like getting all strings between "url":" and ", from this strings
[Code].....
Is there an easy way to find a certain string within a string and then return the strings that you find as an array?I have written this:
Public Function FindStrings(ByVal strSourceString As String, ByVal strStartString As String, ByVal strEndString As String) As String()
Dim StringStartposition As Integer
Dim StringEndPosition As Integer
Dim Currentposition As Integer = 1
[Code]...
I have this string called time. It's value is in this format: HH:MM:SS The numbers change, but the format stays the same. I want to separtate the code into 3 strings Hour, Minutes, Seconds.
View 2 RepliesI have a DataGridView that has some columns with dates. It binds to an in-memory Datatable which gets loaded from an string array of data passed back from the backend Some of the rows returned have nulls for the date columns. Solution 1: If I define the Date column in the DataTable as "string" I can easily convert those nulls to empty strings and display it in the grid as empty strings (desired results). However, if the user clicks on the date column header to sort by date, it doesn't order the rows as you want. You get a purely string sort order. Not acceptable
[Code]...
I have two forms: Main and Options.Main can be moved around the screen (like a normal window).When the user clicks a button, the Options form opens up and the Main form HIDES.How do I set the Options form to open in the exact place that the Main form was last on the screen (to give it the effect the MAIN form never went into hidding)I was thinking to set Option form's StartPosition to Main's current position, but I don't know the syntax for that or if it's even something you can do.
View 4 RepliesHere's the weird problem I am trying to solve but cannot get my mind around it. In a text box 1, the user enters 2 or more strings separated by comma. then in text box 2, the user enter 1 or more strings separated by comma. The output then puts the strings from text box 2 between the strings in text box 1
Example:
TextBox1 = visual basic, java, perl
TextBox2 = is better, compared to
[Code]...
[Code]...
Is it possible to give like this m_qty = ds_uqc.Tables(0).Rows(0)(4)?
I'm Pilipino and im new here . and this is my first time making a program . I used VS2008 my database is access 2007 .. I'm making a program for our hospital.. Im using Listview as my data table. when i delete a row or information . The error is There is no row at position 0 .
View 3 Repliesi have a datagridview. On right click it shows a contextmenu but it is always in the right upper corner. I want it so that the menu appears on the cell where user right clicks. It could be Cell 1 or two or whatever.
View 1 RepliesI have a datagrid named as dtagrdScaleoffinance with 5 rows. Now I want to display the current row in my textbox controls on my MouseUp event.
Here is my sample code
Private Sub dtagrdScaleoffinance_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dtagrdScaleoffinance.MouseUp
Dim rc As Integer
rc = dtagrdScaleoffinance.CurrentRow.Index
getemp(rc)
[Code] .....
Okay so i have created my search form and everything works perfectly when you type into the text box the list box is filtered when you selected a name from filtered list box the customer details are shown and when you select a booking id number for that customers bookings you get the booking information however when i try to close to form i get an error no row in position -1 Since the close button on the form takes you back to the main menu this is an issue but i cant see why its doing this or how to fix it.
[Code]...
i am trying to populate all the emails in my distribution-list where comms = 'to', when my code reaches this part it gives me the error: There is no row at position 2 since i have 2 emails with comms = 'to' [Code] that i could see is that the for loops twice and strEmails shows the 2 emails but it does no stops there it try a third loop ans it stops at row = oTable.Rows(i) then it gives the error.
View 2 RepliesI have a combobox that is triggering the population of some checkboxes depending on the user mode. For some reason, when I put a MsgBox() at the beginning of the function, it works fine. But without that MsgBox(), I get the error that there is no row at position 0. MsgBox("value changed") '<---- this is the box that clears the error
CODE:
How can I get the Y position of the ContextMenuStrip?
View 1 RepliesI have a string like this: mstring = "0123456789ABCDEF"
how can I get the vale at a given position, such as 12?
I know with PHP I can do this:
val = mstring{12}
and it will give me the twelfth value in the string, which would be "C"
I am getting the error there is no row at position 6 but there is data at position 6. May I know if there is any better way apart from this that will "see" the correct number of rows in the database and display out the correct rows in the database? So lets say you have one row auto - increment and one column containing the data. Currently now if i delete off the row no 6 and add back the row, the dataset cannot see this row anymore thus giving me the error, there is no row at position 6.
If i take off the auto - increment row and test this method out, i get the same error.
[Code]...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Clear()
TextBox2.Clear()
End Sub
How do I make the cursor appear in textbox1 after clicking the button?
Given a set of X,Y,Z data points, how would I interpolate a Z value for a known X,Y position? Are there any methods built into .NET to accomplish this. What algorithm could I use?
For example, say I have a graph of X, Y, Z data, and I know the cursor's position. I can find the four closest real data points. I would like to interpolate the z value for the X,Y position of the cursor.
Here is a dummy data set.
(x,y,z)
(-4, -2, 700.065);
(-4, 0, 932.907);
[Code].....
If the cursor was at (.3,.5), could I use the four closest real data points (0,0), (0,2), (2,0), and (2,2) to find the interpolated z value?
I am trying to save my scale configurations in the database so first I have to check if it exists in the database.and I am using the code below to do that . however when there is no data in the database I will get an error "No row at position 0" or when the scale number is not there i will get the same error.
View 8 RepliesI rotate an image, execute a drawstring, rotate it back, execute another drawstringbut when I execute the second drawstring it is further to the right than the original.This is the basic code that I am using.
Call label_inches(PROP8, True, JUST_LEFT, Pen1, _
(TBL_TOP * (517 / 219)), (GRPH_LEFT * (2038 / 875)), GRPH_LEFT, TBL_LIN_DATE_Y, _
"Ending", False, vbBlack)
[code].....