|
Maybe it's just his homework
Your incessant rantings indicate you have a brain the size of a pea, and the mental capacity of a bag of hammers. - John Simmons
|
|
|
|
|
Hi All:
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..
Regards
Pradhip.S
If a Building is Completed then why do they call it BUILDING ??
|
|
|
|
|
<br />
txt_listbox.items.insert(0,"Select one by clicking")<br />
txt_listbox.setselected(0,true)<br />
Hopefully that will work.
|
|
|
|
|
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.
Please help in this regard.
BR
Dammy More
|
|
|
|
|
Hi all. I'm trying to get a panel that only allows you to scroll vertically. This is what I've attempted:
Public Class VerticalOnlyPanel : Inherits Panel
Protected Overrides Sub OnCreateControl()
SetScrollState(ScrollStateHScrollVisible, False)
End Sub
End Class
with no success. Any ideas?
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
can anybody tell me whether vb is
"event driven programming or object oriented programmin or a combination of both.
|
|
|
|
|
I would say both, object oriented and event driven.
Vasek
VB6, C#, MS DNA, MS .NET software developer
|
|
|
|
|
Actually, it depends on the version. VB.Net is OOP but VB6 is only partially OOP. Both versions are event driven
|
|
|
|
|
How to disable image just as vs.net disable toolbar buttons.
|
|
|
|
|
Try this:
ControlPaint.DrawImageDisabled(Graphics, Image, x, y, BackColor)
|
|
|
|
|
Hi:
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.
Thanks.
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.
<br />
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
<br />
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 />
<br />
Open "C:\Temp\China.exe" For Binary Access _<br />
Write As #1<br />
Put #1, , b()<br />
Close #1<br />
Hope that helps.
|
|
|
|
|
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?
|
|
|
|
|
The MSDN Library consists of 3 CD's that will say MSDN Library.
|
|
|
|
|
If you have a Sub or Function with an Optional argument passed ByRef, what happens if you try to muniplate the contents of the variable if it wasn't passed in?
Eldon Zacek
VP of Engineering
Czech-Mate Enterprises, LLC
|
|
|
|
|
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.
|
|
|
|
|
How do I create such a beast? I've search all over the internet for the answer, and have yet to find the solution.
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Hi,
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
Thanking you
Regards
PraveenP
|
|
|
|
|
Hi,
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.
Refer http://www.codeproject.com/useritems/wmi.asp for more details
Ravi Shankar S
Product Designer
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
Hi Guys
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()
Try
message = formater.Deserialize(stream)
RaiseEvent update(message.ToString)
RaiseEvent update(message.ToString & vbNewLine)
Catch e As Exception
MsgBox(e.Message)
End Try
'If message Is Nothing Then Exit Do
Loop
End Sub
|
|
|
|
|
Hi,
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 ...”
....
Close #1
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
p.s
Sorry for my bad English
Tancev
|
|
|
|
|
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
Zulfikar Ali
|
|
|
|
|
Hi all,
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 />
<br />
Msgbox(l = Nothing)<br />
'Results in True<br />
<br />
Msgbox(l = 0)<br />
'Results in True
Even stranger behaviour:
Dim l As Long<br />
<br />
l = 0<br />
<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 />
Get<br />
Return _id<br />
End Get<br />
Set(Value As Long)<br />
_id = Value<br />
End Set<br />
End Property<br />
End Class
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 />
Else<br />
'Save data<br />
End If<br />
End Save
Was it wrong of me to expect such behaviour, or am I wrong somewhere?
Thanks,
Jan
|
|
|
|
|
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
Get
Return _id
End Get
Set(ByVal Value As Long)
_id = Value
_idSet = True
End Set
End Property
Public Sub Save()
If _idSet Then
'Save Data
Else
'Throw exception
End If
End Sub
End Class
|
|
|
|