|
it's not about being "dumb", you definetly aren't. It's more about you level of knowledge of VB.... I thought you were missing the use of the listbox more than other.
Anyway this brief sample code may help you understanding how to populate a listbox:
Listbox1.Items.Clear ' Clean it
Listbox1.Items.Add("One")
Listbox1.Items.Add("Two")
Listbox1.Items.Add("Three")
if you want to do it from an array and d/k how to manage an array then:
Friend myA(3) as string ' Declare the array
myA(0)="One"
myA(1)="Two"
myA(2)="Three" ' Array populated
Listbox1.Items.Clear
for index as integer = 0 to 2 ' Cycle through all the elements
Listbox1.Items.Add(myA(index)) ' Add them
next index
Or finally if you want to take advantage of the AddRange method:
Friend myA(3) as string ' Declare the array
myA(0)="One"
myA(1)="Two"
myA(2)="Three" ' Array populated
Dim myList as New List(Of String)(myA)
Listbox1.Items.Clear
Listbox1.Items.AddRange(myList) ' Add the whole list in a single line
Bye
|
|
|
|
|
Thanks Briga,
it's really appreciated.
|
|
|
|
|
I want to make a screenshot of a control, but with a code I found in the Internet (posted below) the screenshot contains for example the explorer bar or a window that is in front of my control (like a real screenshot). What I want is a screenshot of the control only. My control contains other controls (Container-Control).
And now the code:
Public Function ScreenShot() As Bitmap<br />
Dim formGraphics As Graphics = Me.CreateGraphics<br />
<br />
Dim formImage As New Bitmap(Me.Width, Me.Height, formGraphics)<br />
<br />
Dim memGraphics As Graphics = Graphics.FromImage(formImage)<br />
<br />
Dim sourceDC As IntPtr = formGraphics.GetHdc<br />
Dim targetDC As IntPtr = memGraphics.GetHdc<br />
<br />
BitBlt(targetDC, _<br />
0, 0, _<br />
Me.Width, _<br />
Me.Height, _<br />
sourceDC, _<br />
0, 0, _<br />
SRCCOPY)<br />
<br />
' Release DCs and dispose objects<br />
formGraphics.ReleaseHdc(sourceDC)<br />
formGraphics.Dispose()<br />
memGraphics.ReleaseHdc(targetDC)<br />
memGraphics.Dispose()<br />
<br />
Return formImage<br />
End Function<br />
|
|
|
|
|
hiiii all , i wanna ask how i can make a https request using vb.net , plz i need an example code , thanks
|
|
|
|
|
The documentation for HttpWebRequest[^] gives you some examples of how it is used.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hi Friendz,
Can any body plz explain me the advantages & disadvantages (memory consumption) of shared variables, methods, properties etc
Regards,
Vipul Mehta
Regards,
Vipul Mehta
Software Engineer
Chenoa Information & Software Services Pvt Ltd
|
|
|
|
|
You're a "Software Engineer" and are asking this question?
There is, essentially, no difference between the memory consuption of methods. In both cases, shared or not, there is only one copy of the method code in memory.
Shared variables, on the other hand, only have a single storage location for all declared instances of that variable. That same variable, not shared, would have a storage location allocated for each declared instance. So, of course, uses more memory.
Properties don't denote a storage location, but are merely accessor code to retrieve or set the value of a variable, shared or otherwise. Again, since this code is kind of a "method" to get at a value, there is only one instance of the code in memory for all declared instances of the property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Guys,
I need help to create a windows service. The idea is that i have a webservice which would be serving a list of quotes. I want my webservice to fetch the updated list at regular intervals. The timing can be configured from a config file. I have tried using all the possible methods to do this bu none of them seem to request the list at regular intervals. I have tried using threads,system.threading.timer class and so on but my method is not fired using any of these methods.
In case you can help me just post me a sample windows service in VB.NET.
thanks.
Regards
Wilbur J. Pereira
"If they love me let them, for the heck of it.If they don't, who da heck cares about it"
|
|
|
|
|
That's not how a web service works.
But, in your post, you're not consistent when your talking about your service. Are you writing a Web Service or a Windows Service?
A web service supplies various classes and nethods for a client to call over HTTP. It doesn't run anything until a client calls it. It doesn't run like a Windows Service. You can't set a timer and have it execute code on a timer tick.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sorry for the typo it should have actually been a windows service which would fetch the quotes served by my webservice at regular intervals. Anyways i have already found a solution to the problem. thanx for replying.
Regards
Wilbur J. Pereira
"If they love me let them, for the heck of it.If they don't, who da heck cares about it"
|
|
|
|
|
I created a media player application in Vb.Net with mciSendString API. However, I am not able to retrive the song titles of the tracks on the CD. When I was using Windows XP's media player, I relaized that it was retrieving these hidden information and displaying the original song titles. Also, the media player is able to show the original CD Albume's picture. These information are hidden on the CD.
Do you know how can I retrieve these information (The original song titles, and the picture of the CD albume)?
If you help me, I would really appreciate it! Thanks!
Journey
|
|
|
|
|
B Journey wrote: These information are hidden on the CD.
No, it's not! Media Player retrieves this information from a database on the internet using a CD ID number, but I don't know how to retrieve it. I aldo don't know which CDDB database Microsoft is using.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi,
Could someone tell me how I could get Filesystemwatcher to monitor network drives? I have it monitoring local drives today but when I point it to a network drive does not seem to recognize any changes.
Thanks,
Zenly.
|
|
|
|
|
That depends on what kind of network drives you're talking about. It won't work on Samba (Linux) shares. Also, do not use this to monitor entire volumns. Response to events decreases with the number of directories (sub directories included) that your trying to track.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm trying to monitor a standard share on another windows machine. I even shared out a folder on the local machine and mapped to it and it fsw would not respond to changes on this either. I am running Windows xp sp2 and .nte framworks 1.1. Do you know if fsw changed any in VS.2005? I read a bit about it but I have not seen any major changes regarding fsw.
I'm just monitoring a few directories.
|
|
|
|
|
So long as the account that is running your app has the rights to see the files Modified date/time, it should work. There's nothing special to configure.
I don't know of anything that changed between versions.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Rage,
Yes... It was silly me. I did not use an id with enough privilege.
|
|
|
|
|
I am developing an application that gets streaming video from an ip camera and creates a set of .avi files. I need some way of compressing these individual files (hopefully from within my application) and then decompressing them for playback. Any suggestions?
|
|
|
|
|
Video is usually saved in compressed form. That, of course, depends on the graph that's building the .AVI file from the video source. But, for the most part, the file is already compressed, so trying to compress it again usually won't get you more than 1% reduction in size.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, not sure exactly how to word this so here goes. I have a winform in my project that has the following:
Controls
1. DropDownList1 - Customer Name
2. TextBox1 - Customer ID
3. DropDownList2 - Site Name
DataBase Tables
1. tblCust - Fields(CustName, CustID, Status)
2. tblCustSiteAssoc - Fields(CustId, CustSiteID)
3. tblCustSite - Fields(CustSiteID, CustSiteName, ...)
What I am trying to do is this:
1. When the form open have customers names bound to the DropDownList1 control with nothing selected
2. Once I select something in the DropDownList1 control (SelectedIndexChanged) have it update the other two controls with the selected customers' data.
I assume I make a DataSet that queries all three tables and I understand how to bind the CustName to the first DropDownList box. What I don't understand is how to use the selected information to get the relevant information for the other two controls.
Thanks in advance,
Taen Karth
|
|
|
|
|
When you create your Dataset define a relation between all three tables. It may be better to do this back at the underlying database. Then bind all three controls to the DataSet as you normally would. Now when you select something from DropDownList1 the other two controls will display the proper related data.
I hope this helps.
|
|
|
|
|
Ok I think I need to break this down a little bit more for the relation:
Table1
CustID - PriKey - linked to Table2(CustID)
CustName
Status
Table2
CustID
CustSiteID
Table3
CustSiteID - PriKey - linked to Table2(CustSiteID)
CustSiteName
Addr1
Addr2
City
State
etc...
I have relationships setup like above. I created a new DataSet Item from Add New Item in IDE. Then it asks me to select Tables which I select the three above. It then adds these three tables to the designer with relationships and TableAdapters configured and all.
I then go to DropDownList1 and set the DataSource to the DataSet. It creates a binding source and then I set DisplayMember to CustName and it creates a new TableAdapter.
Now I want to select a customer name in DropDownList1 and have it filter DropDownList2 so that only SiteName shows that has a relationship between CustID and CustSiteID. I can only get DropDownList2 to list all SiteName. I can't figure out how to filter it.
Thanks,
Taen Karth
|
|
|
|
|
To filter use a DataView. You could say something like this:
DropDownList2.DataSource = DataSet.Table3.DefaultView
DropDownList2.DisplayMember = "CustSiteName"
But, since you have the tables related to each other I don't think filtering is neccessary. Instead set it up like this:
DropDownList2.DataSource = DataSet.Table3
DropDownList2.DisplayMember = "CustSiteName"
Since Table3 is in a relation it will show the proper records in DropDownList2
Also, I think you could elliminate Table2 and have CustID in Table3.
|
|
|
|
|
Is it possible to insert a web address in a console project as a hyperlink, and if so, how? I have a function to return a concatenated string as a complete link, but I have found no info as to whether or not it can be active.
J.E.Wier
|
|
|
|