|
Hi All,
The Requirement is like this
I have to Set a Color to ComboBox as Red when Style is Other than DropDownList. How can it be possible in VB.Net. Also it should not be Editable and should be Read Only.
Code:
-----
'Combo Style is DropDown Here
ComboBox1.Items.Add("One")
ComboBox1.Items.Add("Two")
ComboBox1.Items.Add("Three")
ComboBox1.BackColor = Color.Red
'Items in ComboBox are able to Edit!!! which should not happen.
But ComboBox1 BackColor is Red which is OK for Me.
I dont want to Edit the Items in Combo, How it is Possible.
Please give me a solution for this.
Thanks & Regards,
Uday.
modified on Tuesday, January 5, 2010 1:18 PM
|
|
|
|
|
RTFM my friend. The help in VB.NET says "If you set the DropDownStyle property to DropDownList, you can select only valid values from the list. If you set the DropDownStyle property to DropDown, you can type any value in the editable area of the ComboBox."
You said "Style is Other than DropDownList" Why would you want to do that when DropDowmList does the job??
Please ask your homework questions somewhere else.
(As a PS: Thinking about this you could mask the edit area - but not the drop down arrow - with a transparent label, which you could hide when in the correct mode and you can't edit anyway, but it all seems a bit daft to me!)
modified on Wednesday, January 6, 2010 10:16 PM
|
|
|
|
|
Hallo,
I am developing an application where there is a source which sends UDP datagrams at a constant Interval (2 datagrams per second). I am receiving these datagrams in the following code:
EP = New IPEndPoint(IPAddress.Any, clsUDP.nListenOnPort)
' clsUDP.nListenOnPort=6466
UDPInput = New UdpClient(EP)
While clsMisc.ListenforUDP
Try
byt = UDPInput.Receive(EP)
..................
Catch ex As Exception<br />
MessageBox.Show(ex.ToString)<br />
<pre>End Try</pre><br />
End While
UDPInput.Close()
UDPInput = Nothing
EP = Nothing
the flag clsMisc.ListenforUDP is true as long as the application runs. This is set to false when an user Logs off.
This is working properly when a user logs in and logs off three times consecutively. But when an user logs in fourth time. I found out by debugging that the program hangs
after
byt = UDPInput.Receive(EP)
this line. I have also tried with asynchronous connection (Beginreceive and end receive) and also with
UDPInput.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, 0) to flush the buffer before I read the byt but in vain. It is always the fourh time that the problem arises.
I am trying this to solve for the last 3 days without success. I shall be grateful if somebody helps me.
Thanks.
Roy
|
|
|
|
|
When your user logs off are you objects being properly released and disposed.
looking at the mess you have above, you have;
UDPInput.close()
UDPInput = Nothing
EP = Nothing
You may be thowing an exception trying to close the object, which then bombs because it is in a state that cannot be closed.
You should test to see it is open and/or isnot nothing before trying to close.
|
|
|
|
|
Good Morning Dave,
Thanks for your reply. i think yes. Because I checked every time when a user logs off. I do not know exactly how to dispose or release this UDPClient object. I found out only close method. i also tried with UDPInput.client.Shutdown() method, without success. I get no exceptions trying to close the object. If you could tell me how to dispose or release this UDPClient object, I could try to implement it.
As I wrote, it works three times properly but fourth time the Receive method does not work.
Have a nice day.
Roy
|
|
|
|
|
HI,
How to open openoffice document in vb 6.0 ???
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
You're going to have to ask the people who wrote OpenOffice. I have no idea if they have a COM object model for you to use or not, and if so, how you would use it. You'd have to read up on any documentation they may have on the subject.
|
|
|
|
|
m2kannan wrote: How to open openoffice document in vb 6.0 ???
Extract the contents, it's a plain zip-file with some XML documents. And no, I'm not confusing it with Microsoft Word
I are Troll
|
|
|
|
|
Plz send me the solution...
very urgent for us...
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
m2kannan wrote: Plz send me the solution...
Eddy has told you how to do it, what more do you want? Working code? If so, wrong place.
m2kannan wrote: very urgent for us...
.. but nobody else, so now you know what needs doing, go write the code.
Bob
Ashfield Consultants Ltd
Proud to be a Code Project MVP
|
|
|
|
|
There are lots of articles available about working with OpenOffice in VB6. Just Google for openoffice vb6 and you will find plenty of useful links showing you how to do all sorts of things.
|
|
|
|
|
hi,
i got the solution for open the open office document.
this below coding not only open open office document . we can run any application through this coding ....
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Const SW_HIDE As Long = 0
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWMINIMIZED As Long = 2
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", "C:\pdf\v.pdf", vbNullString, "D:\", SW_SHOWNORMAL
End Sub
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
modified on Thursday, January 7, 2010 8:24 AM
|
|
|
|
|
I have a VB.NET program that calls a web service (using HTTP GET). The web service returns two types of files, with different file extensions: .PRD and PRD.OLD). How can I make the VB program check for the presence of either one of the file extensions? I mean: sometimes I need the .PRD files, sometimes I need a .PRD.OLD file). Currently, the VB.NET program will download everything from the web service, and that is not what I want.
I have used the following code:
Dim Request As HttpWebRequest
Dim Response As HttpWebResponse = Nothing
Dim Reader As StreamReader
Dim Result As String
Dim xd As New MSXML2.DOMDocument30
Request = DirectCast(WebRequest.Create(Address), HttpWebRequest)
Response = DirectCast(Request.GetResponse(), HttpWebResponse)
Request.Method = "GET"
Request.ContentType = "application/x-www-form-urlencoded"
Reader = New StreamReader(Response.GetResponseStream)
Dox Girl, where are you?
|
|
|
|
|
Depending of what this service gives you different types of files?
|
|
|
|
|
How you do this depends entirely on what you get back from the web service. If the service just sends you a stream of bytes with the file contents, there's no way tell what the filename is. If the service sends you back a structure with the filename data, great! You've got what you need.
|
|
|
|
|
Friends,
I am Shailesh. I work as a MS VB application programmer. MSCOMM control is used to acquire data from COMM & USB ports. These application programs ordinarily run on (thick) PCs where data is to be acquired and processed.
Recently, one of the clients decided to move away from PCs to HP Thin Clients (TC) T5500. I have been asked to prove the concept i.e. to acquire data on a COMM port on TC.
I have made a set up with Windows NT server (Server 2003) & HP TC t5500. I have built a test program to acquire data from COMM port. This program (of course) runs fine on the server, acquiring data from server COMM port.
I have connected TC in the LAN and ran a RDP from HP TC. The program runs but it acquires data from server COMM port rather than TC COMM port. I have also noticed that if a COMM utility like Hyper terminal is run in RDP, data is acquired from TC COMM port and displayed in Hyper terminal.
This would mean data is transferred from TC serial port thro’ TCP/IP to Server.
Question –
1. How do I acquire data from serial port in a VB program in this set up?
2. I will also like to receive inputs for this set up and get this set up working.
3. Eventually up to 50 TC will be connected on the server. Server hardware will be high end to handle large number of TCs.
4. I have been also told that Citrix or VMware can be used to read data from remote serial port ?
I will sincerely like to receive your inputs.
Thank you in advance. Regards.
|
|
|
|
|
That depends on where your code is running. If it's running on the server, then it has no access to the COM ports on the clients connected to it. You'd need to write a component that runs on the TCs and handles COM communication and transfers that data to the server. The server would not be using the MSCOMM library at all, the clients would.
You cannot use Citrix or VMWare to do this, since both solutions would still be looking at the COM port on the server, not the clients.
|
|
|
|
|
Dear Dev,
Tks very much. I still have a query.
The program runs on the server, client is used almost as a dumb terminal but COMM ports are to be used. As mentioned in my first posting, after running RDP from the TC, serial data from TC port is displayed on a hyper terminal running on TC (Pls note RDP on). Does this not mean data from TC COMM port available to be read by Server ? If affermative, we can explore further possibilities.
Once again tks. Shailesh
|
|
|
|
|
I take it, by RDP, you mean Remote Desktop? Is the server controlling the desktop of the thin client or the other way around??
sachin2 2010 wrote: after running RDP from the TC, serial data from TC port is displayed on a hyper terminal running on TC
So, you running HyperTerminal on the thin client machine and seeing the data that's on the thin client?? Obviously, this would work since they're both on the same machine.
sachin2 2010 wrote: Does this not mean data from TC COMM port available to be read by Server
To a point. The Remote Desktop software can expose the local serial ports to the machine being controlled, but only through the remote desktop software. RDP has its limitations, such as if a connection between machines is broken for some reason, you'll have to restart the RDP session. It won't recover by itself. All you're doing is adding a layer of complexity you don't need and you need.
If all you're doing is taking data from the serial port of each thin client and sending it to the server, you write an application that runs on each thin client and sends the data to whatever server software you have running on the server.
|
|
|
|
|
Dave,
Tks again.
RDP is Remote Desktop. Server is controlling the Thin clients.
sachin2 2010 wrote:
after running RDP from the TC, serial data from TC port is displayed on a hyper terminal running on TC
Dave wrote:
So, you running HyperTerminal on the thin client machine and seeing the data that's on the thin client?? Obviously, this would work since they're both on the same machine.
Sachin 2010 now writes:
Since TC is connected to sever as RDP, when hyper terminal is run on TC, it is an application running on the server. Is my understanding correct ?
or the application is running on TC RAM etc ? If application is on server, how does program read data from TC server ?
Your point about session disconnection is noted. It is an irritant.
Dave wrote:
If all you're doing is taking data from the serial port of each thin client and sending it to the server, you write an application that runs on each thin client and sends the data to whatever server software you have running on the server.
Sachin 2010 now writes:
Yes sir, that is what I want to achieve (amongst other things). The problem is TC has no hard disk, USB port is disabled. Then where do I load VB exe for data acquision from TC serial port?
If there is any other way, I am more than receptive.
Tks again. Kind regards, Shailesh
|
|
|
|
|
sachin2 2010 wrote: Since TC is connected to sever as RDP, when hyper terminal is run on TC, it is an application running on the server. Is my understanding correct ?
No. HyperTerminal is running on the TC. A RDP session remote controls the target machine as if the keyboard and monitor of the machine you were sitting at is connected to the remote machine. All applications you see running on running on the remote machine, not the local one.
sachin2 2010 wrote: Yes sir, that is what I want to achieve (amongst other things). The problem is TC has no hard disk, USB port is disabled. Then where do I load VB exe for data acquision from TC serial port?
The TC's can map a drive to a share on the server and get the apps to run from there.
|
|
|
|
|
In vb6.0, how can i check Internet connection.
that is. Is net connected or not.
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
You mean,goto the Internet or local connections?DO you want to get the state of local connection(NetCard's state)?
I am not a genius, but shed more sweat!
|
|
|
|
|
ya...
bez i want to send mail. so i have to check weather internet connection is avialable or not...
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
|