I've done a customer register in a win form app. and I need to be able to search for a customer fast. If I have more than 100 customers I'd be spending all day to find the right customer by using the previous and next buttons, so I want to have a textbox and a search button. If I write for example just an "A", I want my program to show all customers beginning with an "A". If I write "AN" I want my program to show all customers beginning with "AN".
I have a listbox where each line contains a short 3-4 character model number followed by a tab and then the product name the model number corresponds to. I also have a textbox which I am using to search the listbox.
The code I am using so far works somewhat, just not exactly how I would like. If I enter search text it will highlight the results in the listbox but only for the first characters, is there anyway to search the text of an entire line (index) of a listbox?
Right now I am using the following:
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged ListBox.SelectedIndex = ListBox.FindString(txtSearch.Text) End Sub
I have the following problem: I select a customer from a dropdownlist and then the gridview should load all items of all orders of that customer. I have the following query:
Dim allorders = From ord In db.Orders
Where ord.CustomerID = Convert.ToInt32(CustomerDropDownList.SelectedValue)
[CODE]..............
I also tried to modify the query as follows:
Dim orderitems = From oi In db.OrderItems
Where oi.OrderNumber = (From From ord In db.Orders
[CODE]...........
But this does not work. I just started using LINQ.
A registeration sys using a Microsoft acres database I have a table named customer info to store customer details when registering and I need coding that will add the following to my table customer I'd , firstname, lastname , phonenumber and user also has to make selection between radio buttons male or female.
I am trying to autocomplete customer surnames direct from the Customer Datatable, using the code below which I got from another thread, but nothing is happening.
I have a wrapper class created around TextBox, and I want to find out if there is any way to test if the vertical scroll bar is at the beginning (the very top) of the text box and at the very end of the text box.Alternatively, I will be happy if only I can find out a way to check if a scroll bar is enabled or not in a textbox (note: it's not a RichTextbox).
By enabled, I mean that scroll bar is actually enabled i.e. you can use the scroll bar to scroll the control, not just visible (I know we can check visibility by GetWindowLong)
I need to find the first letter in a message and replace it with the 5th vowel in another string. However it never gets into the condition in Red Color. I also need to keep the count of the characters in the characterarray. ???
How would I find all instances of a letter if it appeared multiple times in a word? For example if I had the word 'mississippi', how would I find every 's' or every 'i' or every 'p'?
I know how to use the string.IndexOfMethod() so I was thinking I could find the first letter, mark that position, and search again from there. Then I would keep looping until the end of the letter. But I'm not sure how to signal the end of the loop.
I'm trying to make a program (in VB 2008 Express Edition) that will take text (from a textbox) and then switch the letters (say a->f and A->F) and will put the result into a second textbox when I click a button. How do I code the program so that it will search through the textbox and find all of a certain letter (say a) and replace it, then search for the next letters (say b-z) and replace them?
I want to make live search form like when user enter 1 char then it ll find all data start with or contain letter.i have use the sql like query with textbox textchanged event but it is too slow any other method to make it fast?
I have a binary converter I am attempting to build and want to read and convert the InputTextBox(alphabetical characters) letter by letter however all I have so far is one letter at a time
Image here is the code I have so far:
Code: Public Class ConverterForm Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
I am a vb newbie having some trouble with an assignment. A user enters a letter into a text box, and the output must make the letter uppercase and tell what position the letter is at in the sentence "The quick brown fox jumps over a lazy dog."
Here is my
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
[CODE]...............
This is what comes out: "A first occurs in position -1". Everything comes out except the position is always displayed as -1.
Is it possible to change to colour of letters as they are typed.I.e
Piece of text says "Hello World"
when user types "H". The "H" in the original would change if matched and then so on and then when "Hello" is matched it would change to another colour.
I'm using a timer control to highlight text letter by letter one every second. Timer1.Interval = 1000 How can I give the user access to this variable so the speed can be changed?
I'm a VB beginner.I wonder if it's possible to change the text style letter by letter?I've learned here that you can change the entire style of text like
Dim myStyle As New Font(TextBox1.Font.Name, TextBox1.Font.Size, FontStyle.Regular) TextBox1.Font = myStyle
When I exit the programme and start it again the checkbox selection from the previously job gets lost. After starting there is not a problem until I exit and start the programme again.
DnsGetHostEntry takes an IPaddress as an argument but the one I'm supplying it while debugging is throwing an exception of "No such host is known" when I know that this is a perfectly valid host.
Somehow a space or character has been introduced at the beginning of the strong as per the text in quotes below. I tried a Trim(" ",
" 10.0.110.37" "" & vbLf & "10.0.110.37" this is what I see when clicking on Edit Value in Quickwatch
I have an VB.NET app that writes the status to a log file in text format. Over time, the file is getting large and I wanted to know if there is an efficient way to truncate the beginning of the file.
To make things easier, I am looking to specify a file size (say 2-3 mb) and I am writing the log using a StreamWriter:
Using strm As New IO.StreamWriter(filelocation.log, True) strm.WriteLine("msg to write") strm.Close() End Using
I thought about using the strm.BaseStream.Length to determine how much of the file to cut off, but by using the .SetLength it would cut from the end - not the desired result.
All appears well, except for the zip codes that begin with a zero. I'm using a case statement to verify the zone, but VS2010, helpful as it is, removes the the lead zeros, after which said zip codes won't verify.strZip is put in through a text box, and a debug.writeline will tell me that VS stores it correctly, with the leading zeros. But when I get to the Case statement, it just will not let me look for a zero initiated number. I felt I was doing well by going with a string rather than something more numerical, but that apparently isn't enough.
Excerpt: dim strZip as string Select Case strZip[code]....
Im trying to create a new file at the begining of each month, and stay active for the rest of the month by adding the textbox info to it every time someone presses the Next or Exit button. Next and Exit button update the files Im not sure would it be easier to get the info across to Excel or sql server, but i woudlnt know how to do that, if that would be easiers.Aim of the what im doing, person logs button presses with the text files logging the number of presses of each of the buttons. then at the end of the session or when the user moves to the next item to be logged the files then save the counted section. need to it log everything for the month. Just trying to get the info into sqlserver 2008 as im logging each job as well.
If Me.DateTimePicker1.Text = "# october 2009" Then ' logging the monthly total Using SW As New System.IO.StreamWriter(faultsfile) SW.WriteLine(TextBox10.Text)
how can i get the number of spaces in the beginning of each line before a word..following code is just for example reasons, not to be misunderstood for code that needs to be fixed.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Clipboard.GetDataObject.GetDataPresent(DataFormats.Text) Then RichTextBox1.Paste() RichTextBox2.Paste() End If End Sub
Im trying to remove all text before "Informations here" this is what i currently have.
dim mychar as char () = {"<"c, "s"c, "p"c, "a"c, '....thatandlike20moretill.... "e"c, """"c} string1 = string1.TrimStart(mychar)
(Note that each letter or symbol inbetween the quotations is a part of the string (span = "s" "p"...)Now this works. Not all the time though and its a pain in the .. having to do "letter"c, all the time.. (I got over 10 strings lol) Im wondering if theres a way easier method to remove part of string from the beginning, maybe like still a certen part of the length..
This is what I am trying but it doesn't work. The idea is to rest the caret position at the beginning after I hit enter and the conents od Textbox1 are deleted
Private Sub TextBox1_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then