For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have a combobox which lists down lot of values like Apple, Ant, Cat, Carrot,Costco etc. But I want it to work as follows.
so when I type "Ca" on combobox it should show only those in the list that starts with "Ca" In this case its carrot and Cat.
This is a windows application developed in Vb.net.
Please let me know how to achieve that.
Your help is much appreciated.
Dim a As String = "99999999"
Dim m As String = "3333"
Dim a As String = "77"
Dim u As String = "07"
Dim v As String = "00"
Dim result As String = ""
result = W(a, m, v, u, a, Block)
a, m and Block are not accepted.
I'm not a C# expert so I guess that there is something to be done in order to correctly address strings and arrays between the two languages. Must be kind of basic rule I ignore...
Anybody can help?
I have a user control with two buttons on it. I want to make everything except the buttons transparent, so the main form on which it loads can be seen behind it. There is no code behind on the user control class, but in the designer I have set the backcolor property of all controls to Transparent. When I run the program, I can see different controls behind the button images.
Is there a way to add images here? The problem is, while all controls (user control and the 2 buttons on it) have their backcolor property set to Color.Transparent, when I run it, it's not transparent. The background shows an image of wherever my mouse moves on main form. I think the background of the user control does not refresh properly, but I am not sure how to handle this.
For example, if my mouse is on Button 1, then the background of Button 2 changes to the image on Button 1.
You need to create a simple text application to try and figure out where the problem is. Make a simple form with no more than three controls, in a similar configuration to what you have already. Then run some tests and see if you can identify the exact circumstances of the problem.
Transparent only tells the control to take on the background properties of the control that contains it.
Using the properties of the controls in Windows Forms, you CAN make the entire form really transparent, but you can only make the ENTIRE form, along with ALL of its contents, transparent. You cannot single out a control to be not transparent.
It can be done using calls to Win32 functions. Start reading these[^].
Well my previous post, the await part didn't work, and it operated synchronously.
The main code was suppose to pause and wait for the download to complete and the program to install before moving forward, but just ran to the end.
The previous code I wrote had awaits everywhere in the main code. I really just wanted to call a class that would do the whole thing for me in 1 shot, while the main code waits for the class to finish.
I'm not really sure what this is called in .NET to look up info; perhaps a delegate. And how to adjust my code, and get rid of the await if I have to.
Calling the class, I use to have the await here as well, but then the await kept going up the chain, until finally everything was an await task in the main program - hard to explain.
I didn't think it would be this hard, and I'm having trouble sifting through all the information on the net, and choosing the proper direction / method to take.
My Class - I really just wanted to call this class, and wait for it to finish, but be able to update my progress bar and label. It's a pretty long task, perhaps 10 minutes or so.
The code in the class actually works correctly, and does what I want, just doesn't pause and wait.
Public Async Function httpWebRequest_With_Progress( _
ByVal url AsString,
ByVal s AsString,
ByVal pLabel As Label,
ByVal pBar As ProgressBar) As Task(OfInteger)
Dim desktop_Save AsString = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\SqlLocalDB.msi"Dim webClient As Net.HttpWebRequest = DirectCast(Net.HttpWebRequest.Create(url), Net.HttpWebRequest)
webClient.AllowAutoRedirect = TrueDim resp = Await (New TaskFactory(Of Net.WebResponse)).StartNew(AddressOf webClient.GetResponse)
pBar.Value = 0
pBar.Maximum = CInt(resp.ContentLength)
Dim rqs = resp.GetResponseStream
Dim bufferSize AsInteger = 1 << 16Dim buffer(bufferSize) AsByteDim bytesRecieved AsInteger = 0Dim bytesTotal AsInteger = 0Dim fs AsNew FileStream(desktop_Save, FileMode.Create)
bytesRecieved = Await (New TaskFactory(OfInteger)).FromAsync(AddressOf rqs.BeginRead, AddressOf rqs.EndRead, buffer, 0, bufferSize, Nothing)
bytesTotal += bytesRecieved
fs.Write(buffer, 0, bytesRecieved)
Dim m_Bytes AsString = "Downloading " & (Convert.ToDouble(bytesTotal) / 1048576).ToString("0.00") & " MB" & " / " & (Convert.ToDouble(pBar.Maximum) / 1024 \ 1024).ToString("0.00") & " MB"
pLabel.Text = m_Bytes
Loop Until bytesRecieved = 0IfNot fs IsNothingThen
EndIfIfNot rqs IsNothingThen rqs.Close()
IfNot resp IsNothingThen resp.Close()
frmSetup.lbl_localDB_Title.Text = "Installing Microsoft SQLLocalDB.msi"
pLabel.Text = "Installing SQLLocalDB - Please Wait"
pBar.Value = 0'Install the Microsoft LocalDB Software
Using localDB As Process = New Process()
Dim localDB_PS AsNew ProcessStartInfo
localDB_PS.FileName = desktop_Save
localDB.EnableRaisingEvents = TrueAddHandler localDB.Exited, AddressOf localDB_Exited
localDB.StartInfo = localDB_PS
Do'Do Nothing, just wait and enjoy the ride
IfNot localDB.HasExited Then
pBar.Value = If(pBar.Value < 99, pBar.Value = pBar.Value + 0.1, 0)
EndFunctionPrivateSub localDB_Exited(ByVal sender AsObject, ByVal e As System.EventArgs)
' Your code goes here
Sorry for all the code, Just wanted to make sure the picture was complete, I rarely post this much code.
Last Visit: 31-Dec-99 19:00 Last Update: 21-Dec-14 0:54