|
However, after posting my question I did find a way to do it, and after getting a lot of answers like yours I decided to write the following article:
http://www.codeproject.com/useritems/LockKeyboard.asp
Thanks again,
Haim.
|
|
|
|
|
I didn't say it was impossible, just a bad idea! This is something you must be VERY careful to do. I for one, would NOT want my keyboard and mouse disabled for 20 seconds while I go off and do other things while this process is busy performing a long operation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I know there must be a way around this problem I am having, but for the life of me, I cannot find it.
We are currently programming applications in VB.NET, trying to implement Visual Source Safe 6.0.
Our problem, is that we use a large ammount of custom controls and other classes which are shared among various application we are building. How do we get this righ using Source Safe? In essence we need to be able to add solutions to source safe, which in turn can be referenced by any other number of solutions, also kept in source safe.
Please help.
Thanks.
|
|
|
|
|
We had a similar problem, It may be of some help to u,
u can create add the common project to ur existing soln and
put it vss. so that when u get the soln to ur local copy
u get both the projects along.
(In our case the no of projects were less so we got away with this)
cool man
|
|
|
|
|
Hi all,
Is this possible to display a windows form from a remotable object?
I need to create a singlecall server application that gives access to an instance of MapPoint ActiveX control to its clients. And I also would like to display a form from the remotable object containing the ActiveX, so I can see the actual maps being retrieved by the remote clients (for debugging purposes).
In a sense I need to create an Automation-enabled app, so that I can interact with it programmatically or via user interface at the same time. Is this possible with .NET remoting?
Thank you for your input.
Alex
|
|
|
|
|
hi there!please help me with this..we get the data from the TSD(test system directory) and these relaymon data have relaycounts. what im doing is i summed up the relaycounts using the pivot table(in excel).after it summed up,the pivoted data shows.the data(relay monitoring data) have their equivalent relaycode, and these were save in another worksheet.what im trying to do is to get that equivalent relaycode in the worksheet where the pivoted datas are.how will i do that?i couldn't used of select case statement because there are thousands of datas in TSD.each day it has thousands of datas saved.so how am i supposed to do that?pls help me..need asap...tnx a lot!
|
|
|
|
|
i want to record clips using a web cam in vb.net code
can any body help me please on this
if possible send me code on this which will be handy
thanx in advance
i am a sr: Software Engg
|
|
|
|
|
Hi there,
I have been trying to get to read from one DB into a dataset. Then read from the dataset into an XML file and then read from the XML file into a second dataset. Now all of this I got right but the part where I update the DB (a different one to the original) is not working. I am not getting any errors but the table stays empty.
I prosume that the problem is the same as mentioned by Ami but I would appreciate any comments or help regarding this. Below I have included the part of my code that does this.
Kind regards!
Etienne
Dim myAdapter As New SqlClient.SqlDataAdapter
Dim myAdapterLocal As New SqlClient.SqlDataAdapter
Dim objData As New ExtITPOSData.Data
Dim myConnServer As New System.Data.SqlClient.SqlConnection(objData.GetConnectionString)
Dim myConnLocal As New System.Data.SqlClient.SqlConnection(objData.GetLocalConnectionString)
Dim dsServer As New dsSyncronization
Dim dsLocal As New dsSyncronization
'--put data into dataset
myAdapter = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnServer)
myAdapter.Fill(dsServer, "Tax")
dsServer.WriteXml("../Tax.xml", XmlWriteMode.DiffGram)
myAdapter = Nothing
dsServer = Nothing
myAdapterLocal = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnLocal)
Try
dsLocal.ReadXml("../Tax.xml", XmlReadMode.DiffGram)
Catch FileNotFound As FileNotFoundException
' The XML data must be written before it can be read
MsgBox("No XML file available. View data online and save to offline.", MsgBoxStyle.Critical)
End Try
Dim myCmdBuilder As New SqlClient.SqlCommandBuilder(myAdapterLocal)
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
myAdapterLocal.Update(dsLocal, "Tax")
Thanx!
|
|
|
|
|
Cyberclown wrote:
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
myAdapterLocal.Update(dsLocal, "Tax")
Have you tried checking what SQL the CommandBuilder generated? All you need to do is either stop the program on the .Update statement and look at the InsertCommand property of use
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
Debug.WriteLine("Command Builder generated: " & myAdapterLocal.InsertCommand)
myAdapterLocal.Update(dsLocal, "Tax")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
can someone help me with this
on my machine
obj.SmtpServer = "mailserver" works and
obj.SmtpServer.Insert(0, "mailserver") returns the CDO.Message
on a server running windows server 2003, its the opposite... this is ticking me off since i need to change the code when i try to make it works, any of you guys have an idea?
|
|
|
|
|
CDO.Message is a class, not an error. I take it your getting the "Could not access 'CDO.Message' object."
Every versoin of CDO I can find defines the SMTPServer field as a String . I can't find a single reference to an Insert method for the SMTPServer field or that the field is defined as a colleciton.
But, I'm not saying your lying or don't know what your talking about. What you might want to try is hitting F2 and navigating down the object browser to find the CDO object and the SMTPServer property. There, you'll be able to see if SMTPServer is defined as a string or a collection.
In either case, you'll have to write code that either attempts to get the CDO Version installed on the machine and sets the field using the appropriate method, OR tries setting the SMTPServer field using one method and if that fails (Try/Catch block) tries the other method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks i will try the try/catch method since i dont know how to check the version :/ im still a beginner
|
|
|
|
|
I write a codeDom program.
where i add the following statement to the code:
property1.SetStatements.Add(New CodeAssignStatement(New CodeFieldReferenceExpression(New CodeThisReferenceExpression, strFieldVal1), New CodePropertySetValueReferenceExpression))
the run result is:
Set
MyBase.CurDataRow.Item("CusID") = Value
End Set
It miss the "(ByVal Value As String)" statement.
How can I display this statement?
|
|
|
|
|
|
I need a way to add copy to a listbox when right click is pressed, and using multiple select expanded. TIA
|
|
|
|
|
Has anybody ever noticed that when you right align a column in a datagrid that the last character of the columnheader text is nod displayed properly? I've tried adding spaces at the end of the text but it is trimmed and the same thing is displayed. Anybody know of a workaround?
|
|
|
|
|
Soory - I've had the same problem, and would like a solution too.
Good luck!
Jimbeau
|
|
|
|
|
Hi all,
I have a little problem: by application is generating a report and it takes some time.. so I want to show a little "please wait" always-on-top window while the report is generated.
I created a form with a "Please wait" label and a timer that animates a bitmap every 500 milli. And this is how I call it from my app:
dim frm as new frmWaitMsg
frm.Show
GenerateReport
frm.Close
And it doesn't work! The message form doesn't load properly. I can see the frame, but the CPU doesn't complete the task: the insides of the form are not drawn until the report is complete. So I tried running the report in a seperate thread, but I don't know how to deal with all the yielding problems. I wrote something like:
dim frm as new frmWaitMsg
dim t as new Thread(GenerateReport)
frm.Show
t.Start
t.Join
frm.Close
But then, it looks like the Join blocks my form, and I get the same results
How do I do this?
Thanks,
/=/=/=/= Sagmam =\=\=\=\
|
|
|
|
|
I am having the same problem here. I even tried a fade effect on a timer with the forms opacity to get redraws in a thread and it just draws the frame with a black box inside. Funny enough though, it works perfectly launching from Visual Studio. But it hassles when running standalone.
I use a similar code block to yours, but have also tried at least 5 other approaches.
Any help???
Greg
|
|
|
|
|
I finally solved this thing with a solution that I like. Basically, I use the Observer Design Pattern to create an ObservedThread class.
In VB.NET, I implement this using events. The class has 2 events: Started and Ended.
The class is really simple:
' we can't derive from Thread so we use composition.
' Unfortunately, this means that we have to create the Thread
' interface in this class, but for this example, we'll only
' expose a Start method.
Imports System.Threading
Public Class ObservedThread
Protected Thread As Thread
Protected StartProc As ThreadStart
' some useful events:
Public Event StartedArgs(ByVal Thread As ObservedThread)
Public Event Started()
Public Event EndedArgs(ByVal Thread As ObservedThread)
Public Event Ended()
Public Sub New(ByVal StartProc As ThreadStart)
Me.StartProc = StartProc
Thread = New Thread(AddressOf ThreadProc)
End Sub
Protected Sub ThreadProc()
StartProc()
RaiseEvent EndedArgs(Me)
RaiseEvent Ended()
End Sub
Public Sub Start()
RaiseEvent Started()
RaiseEvent StartedArgs(Me)
Thread.Start()
End Sub
End Class
And let's assume you have an independent form, that you want to appear while the thread executes, and close when the thread finishes. The form has nothing to do with the thread. It's a simple form, that has a timer ticking every few millisecs:
dim frm as New frmPleaseWait
Dim th As New ObservedThread(AddressOf DoSomethingHeavy)
AddHandler th.Started, AddressOf frm.Show
AddHandler th.Ended, AddressOf frm.Close
th.Start()
That's it. Works great.
/=/=/=/= Sagmam =\=\=\=\
|
|
|
|
|
Is this VB6 or VB.net?
In VB6 simply add a doevents to the code
eg
dim frm as new frmWaitMsg
frm.Show
doevents
GenerateReport
frm.Close
I think there is something similar in .net but it is application.doevents
Jon
|
|
|
|
|
Anybody to help connecting a VB6 program to access a database in SQL Server?
|
|
|
|
|
You should use ADO reference or ADO control to connecto your SQL server. The suggest step for you (if you are the beginner), try to connect to database by using a wizard. Then learn from the connection string. If you have some problem to remember the connection string, try to read the information from here.[^]
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Thank you very much sir. I'm a beginner, could you please tell me how to get the ADO wizard? i got some codes(strings) from some books and it doesn't work. it says 'object not found' etc. is it something related to user connection? really i don't know how to do it. please help me.
|
|
|
|
|
first is to create a reference to the ado library. to do this select references from the project menu and tick the 'microsoft ActiveX Data Objects 2.7 Library' box.
The Code to connect to SQL Server and Create a basic recordset is as follows:
dim cn As ADODB.Connection
dim rs as ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionTimeout = 25
cn.CommandTimeout = 120
cn.Provider = "sqloledb"
cn.Properties("Data Source").Value = YourServerName
cn.Properties("Initial Catalog").Value = YourDatabaseName cn.CursorLocation = adUseClient
cn.Properties("Integrated Security").Value = "SSPI" 'If using Windows integrated security
cn.Open
set rs = new ADODB.Recordset
rs.open "Select * from yourTable",cn
You now have a basic recordset
Dont forget to close everyhing and set to nothing when your done.
Sorry if it sounds basic but you did say you are a beginner
Jon
|
|
|
|