I have a peculiar Challenge and need a work around.There is a form that my application uses which has a drop down list being populated at run time.And there can be a case when there is no data to populate it.
Apart from the data being populated i want the dropdownlist to have the option "Select one by clicking" as the default selected option in this listbox.I have managed to do it by the commands txt_listbox.items.add and then selected the option using txt_listbox.items.findbytext("---").selected=true
but then the challenge is this option though gets selected is the last item on my dropdown listbox after all the data from the datatbase..But i want it to be the first..How do i do that.
If i try adding this entry and then populating from the database the database entries wipe out this entry or i get some nasty errors.
Any help is greatly appreciated..
If a Building is Completed then why do they call it BUILDING ??
Anyone know of a good component or tool for VB.NET that will manipulate image(s) stored in SQL BLOB fields? I'm looking for something that will convert on the fly to jpeg, gif or some other smaller compressed format.
I am developing an application which needs to update the Tahoma.ttf font on Win9x machines (update means to delete and then insert) . According to MSDN, to delete font from Fonts directory, one needs to call RemoveFontResource(font-file) and SendMessage(...) to notify all top level windows.
Now I am getting problem when doing this.
Similarly if I do this from Windows Control Panel, it successfully updates the font file.
I would like to write an application with an automatic upgrade feature. Every time the application is executed, it should check if newer versions of certain DLLs are available. If yes, download and replace those DLLs.
Could anyone recommend a good resource and/or a example on how this can be implemented.
A reasonable man adapts himself to the world. An unreasonable one persists, trying to adapt the world to himself. That is why all the progress in the world depends on the unreasonable men.
I don't know if this is the best way, but since it has been some time since you posted this, I'll take a shot at it.
You could use a Microsoft Internet Transfer Control to check versions listed in an html file.
Dim sTest as String<br />
Dim sUrl as String<br />
sUrl = "http://www.your-url-goes-here.com/versions.txt"<br />
Inet1.AccessType = icUseDefault<br />
sTest = Inet1.OpenURL(sUrl)<br />
Then, you would need to compare the versions that you stored in that file with the versions of the files on the user's computer. There is likely a way to access the versioning information (I cannot find it right now,) but you could always have your application maintain a similar file on the user's computer that could would contain the versioning info.
Then, you could use the "OpenURL" to grab any needed files (saving them as binary.)
Here is the sample from MSDN
Dim b() As Byte<br />
Dim strURL As String<br />
' Set the strURL to a valid address.<br />
strURL = "FTP://ftp.GreatSite.com/China.exe"<br />
b() = Inet1.OpenURL(strURL, icByteArray)<br />
Open "C:\Temp\China.exe" For Binary Access _<br />
Write As #1<br />
Put #1, , b()<br />
Close #1<br />
I am new at all this, and this looks like a pretty good place for advice, these guys know what they are talking about.
O.K. I am studying programming and have managed to buy a full set of Visual Studio 6.0 Enterprise Edition. Three CD's. In bold there is written, msdn and Office Test Platform & Development Tools.
So what's the problem.
The platform works normally, but the help files won't load.
During the installation, when prompted for msdn CD No.1,
it will not accept it, and it is the same place I have just loaded the program with.
What am I doing wrong?
VB.NET: All optional variables have a constant default value. If no value is passed in, the argument will have the default value. You can manipulate it as much as you like, but when the procedure exits, your changes will be discarded.
VB6: Optional arguments can have default values, in which case the same rules as VB.NET apply. If they don't have a default value, you will get an error when you try to access them. Use the IsMissing function to determine whether a value has been passed in.
Can anyone please clarify me in the following problem?
I have created an application in vb.net, which runs some process in background using task scheduler. when I access a network folder like "\\server\somedir" in my GUI it will work, because the loggedon user has permission to that network folder to connect. but I am running the background task as different user who is not having permission to that nework folder. But in windows 2000,XP, when we try to access to that nework folder using network places, it will prompt for username and passwork to connect to network folder. If I know this username and passwork in my background process, how should I connect to network folder in my vb.net programme. After some struggle, I came to know that I need to use CreateProcessWithLogonW API for this. But I am not able to make it work in my VB.net programme and connect to that network folder. And I tried impersonate the user and then create process using System.Diagnostics namespace. but in this case creating process will not take the impersonated user credentials, it only considers default loggedon user credentials. I have tough time in finding this.
Please Help me as soon as possible
I sense that You wanted to execute a file on a remote machine. You can create a process in remote machine using WMI. Try reading documentation on System.Management Namespace which speaks on WMI. Creating a process in this way can impersonate the user credentials that you have specified by your background process.
Im making a messanger for myself... in vb.net... everything works greate if i use text, but as soon as i try to send an object through sending works fine but receiving gives me lots of problems...
Canyone help me with this?
Here is my code for receiving
Public Sub listen()
Dim formater As New BinaryFormatter()
Do While True
Dim message As New Message()
message = formater.Deserialize(stream)
RaiseEvent update(message.ToString & vbNewLine)
Catch e As Exception
'If message Is Nothing Then Exit Do
In VB6 i use this sample of code to print directly to the printer.
I mean EPSON compatibile dot-matrix printers
Open “LPT1” For Output as #1 Or
Open “\\Server\printer” For Output as #1
Print #1, “something i what to print”
Print #1, “something else ...”
What I need is to open printer port (LPT1 or \\computer\printer ) like any other file on hard drive, as simple as posible.
I don’t need to print any graphics, just draft (plain) text with a lot of ESCAPE sequences like Pica,Picacondesd, Elite ...
When I use
FileOpen(1, “LPT1”, OpenMode.Output)
PrintLine(1, "This is a test.")
in VB.NET I get an error
Additional information: FileStream was asked to open a device that was not a file. FileStream's constructors that take a String will only work with devices that are really files. If you need support for devices like "com1:" or "lpt1:", then call CreateFile yourself then use the FileStream constructors that take an OS handle as an IntPtr.
Let me know if you have any sugestions for my problem
Thanks in advance
Is anyone familiar with Right Fax From Viewer? You can add that to your toolbox from COM Components. The reference name is AxInterop.AXRfaxVwRctrLLib. I can add this control and if i load a tif file in the property it works but not in the run time. this is pretty cool tool for editing .tiff files. if anyone has any luck please let me know. your help will be greatly appreciated. thanks
In .NET all data types (Integer, Long, String, ...) are objects. But in my opinion, these data types don't really behave like normal objects. I noticed the following behaviour:
Dim l As Long<br />
Msgbox(l = Nothing)<br />
'Results in True<br />
Msgbox(l = 0)<br />
'Results in True
Even stranger behaviour:
Dim l As Long<br />
l = 0<br />
Msgbox(l = Nothing)<br />
'Results in True
I hoped that in .NET there would be a way to determine if a variable has been set or not. For example you have a class with a ID property (long), you would implement it like this:
Public Class Test<br />
Private _id As Long<br />
Public Property ID As Long<br />
Return _id<br />
End Get<br />
Set(Value As Long)<br />
_id = Value<br />
End Set<br />
End Property<br />
Suppose you would like to have functionality in this class, to save the data. In de Save sub, you would like to check if the ID property was set or not. I hoped you could do it like this:
Public Sub Save<br />
If _id = Nothing Then<br />
'Raise error to tell the ID property was not set.<br />
'Save data<br />
End If<br />
Was it wrong of me to expect such behaviour, or am I wrong somewhere?
First, you can't check for null references with If x = Nothing ... - you have to use If x Is Nothing ...
Second, you can't perform reference comparison on value types. If x is a value type, If x Is Nothing ... will not compile.
Try something like:
Public Class Test
Private _id As Long
Private _idSet As Boolean = False
Public Property ID As Long
Set(ByVal Value As Long)
_id = Value
_idSet = True
Public Sub Save()
If _idSet Then
Last Visit: 31-Dec-99 19:00 Last Update: 1-Dec-23 20:44