|
Dear sirs:
I need an application to discern two sources of USB keyboard input from the same machine. What would be the easiest way to accomplish this?
Thank you,
Rob Hyland
|
|
|
|
|
There is no easy way to accomplish this. A keydown message is the same as any other keydown message, regardless of which keyboard it comes from. There's just no data to look at to tell which keyboard it came from.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello, I have a problem to output multiple value to one column in datagrid in vb.net.
here is the column name in the database table
street_number1, street_name1, street_number2, street_name2, street_number3, street_name3, street_number4, street_name4, street_number5, street_name5
In the vb application, bind to two colunm(street#,street name) in datagrid. how can I show them like below?
entity_id street# street name
01101 1 XXX
2 XXX
3 XXX
4 XXX
5 XXX
anybody can help??
Lisa
|
|
|
|
|
Do an onitemdatabound handler for a label or something, then in code pull out the two values and format them.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Would you please give me some example coding? I have no idea for the onitemdatabound handler.
Thanks
Lisa
|
|
|
|
|
There's a ton of info in MSDN, or try google.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I am looking to dynamically generate a value (which will be shown in a textbox) depending on which rows in a datagrid are selected, rows may be selected/deselected by the user and the value will change dynamically depending on certain fields in the selected rows. Iterating through the rows to find which ones are selected is not my dillema, the problem is that I cannot find an event that fires when a row in the datagrid is selected/deselected. I would rather not force the users to click a "calculate" button. It seems that a "RowSelected" event on the datagrid would make most sense, but I cant find any info on such functionality!! I suppose I could use the "OnMouseUp" event, but then the user would be forced to use the mouse to select rows, no shift/ctrl + arrow keys!.
Any suggestions?
Thanks,
done
|
|
|
|
|
Here are 3 ways to do this.
1:
Dim currentCell As DataGridCell = DataGrid1.CurrentCell
'Get the value out the DataGrid and store it in the variable
Dim a As String
a = DataGrid1(currentCell.RowNumber, CurrentCell.ColumnNumber).ToString()
2:
Private Sub grdData_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdData.Click
txtKey0.Text = grdData.Item(grdData.CurrentCell.RowNumber, 0).ToString()
txtKey1.Text = grdData.Item(grdData.CurrentCell.RowNumber, 1).ToString()
End Sub
3:
'Another way to get datagrid row and column
Dim nRow as Int = dataGrid1.CurrentCell.RowNumber
Dim nColumn as Int = dataGrid1.CurrentCell.ColumnNumber
Let me know if this helped you or not.
|
|
|
|
|
Can anyone tell me why the Beep command does not work on my new computer, a Dell Optiplex GX280. I would appreciate the solution or workaround to this, I bet, simple problem.
|
|
|
|
|
Ask Dell. But, my first guess is that the PC speaker is not plugged in or something else. The Beep function is so generic, there's nothing that can go wrong with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how could i insert images or comboboxes(dropdown list) or buttons to a datagrid in VB.NET
|
|
|
|
|
you can find help on how to subclass the datagridcolumnstyle object here.
there are also numberous other examples of this if you search on google groups or msdn.
-jim
|
|
|
|
|
You can find many examples on the internet of how to do this, but if I were you i would go to www.rustemsoft.com and look at their product. It gives you alot of options for a datagrid and it does not cost very much.
I have a class for adding a dropdown combobox to a datagrid. If you want that let me know and i will paste it to one of these responses.
|
|
|
|
|
Can anyone post an example of how to interface the CE MAPI routines using .NET Compact Framework (preferably in VB)?
I have a need to generate an email message and place it in the outbox under a VB.NET CF application. IDeally with the ability to attach a file?
I can find no examples anywhere which I can understand! I am a good VB programmer, but the C++ examples are leaving me struggling.
Thanks to anyone who can help.
Alan
|
|
|
|
|
Hi,
Any of you know the property in wich the user can select the printer to print the report.
thanks
|
|
|
|
|
most likely what you're looking for is the printoptions property of the reportdocument object. there's also the standard printoptions class under crystaldecisions.crystalreports.engine namespace, but the reportdocuments printoptions property is set to read only in the reportdocuments implementation. so all you have to do is set the printername property.
Dim rd As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rd.Load("myDocumentTemplate")
rd.PrintOptions.PrinterName = "myPrinter" hope this helps.
-jim
|
|
|
|
|
Hi all,
How can i convert an object wich contains a date value into a string value.
Thanks,
|
|
|
|
|
by an object which contains a date value do you mean an actual date object or an object which has a property "X" which is a date?
regardless, just use the .ToString method that's implemented on any object. if the object itself is a date then use myDate.Tostring(). for an object which has a date property, just use myObject.DateProperty.ToString().
there are also a few overloads of the ToString method which will acccept formatting options which will help you format the resulting string value in a more useful way. you can find those here.
-jim
|
|
|
|
|
Hi,
I am aware that DDE is not supported in VB.NET, but I wanted to try to get it working anyway. It seems to me that the easiest way to get it working would be to create an instance of a VB6 Textbox within a .NET application. The problem I ran into is that the compiler tells me that the constructor for the VB6 textbox is private, and can not be used.
If I try to take out the "New" statement, I get a Null reference exception.
I am adding a reference to Microsoft Windows Common Controls to get access to the MSForms Namespace.
Thanks.
|
|
|
|
|
Sarphus wrote:
am aware that DDE is not supported in VB.NET, but I wanted to try to get it working anyway. It seems to me that the easiest way to get it working would be to create an instance of a VB6 Textbox within a .NET application.
The easiest way is to create a VB6 DLL or a VB6 UserControl that encapsulates everything that you need to do. Then declare public methods as needed to run the process from your NET application. Import the DLL or OCX into NET and you can essentially run your VB6 code as unmanaged code from within a NET project.
Robert
|
|
|
|
|
Thanks.
I was in the process of trying to basically do that, but was hitting a couple of snags (a little out of practice on writing OCX). At least I know it can be done.
|
|
|
|
|
hi
can i add items of type Object rather than strings to a ListView control? how?
|
|
|
|
|
can i add items of type Object rather than strings to a ListView control?
No
Only Strings or ListViewItems
|
|
|
|
|
I am trying to recognize text from a recorded wav file.
I use MS Speech SDK 5.1 and VB.Net.
Here's my project . It compiles OK but i get nothing as a recognized text.PLEASE HELP!
I have an initialise function ,an openstream function to open the file i want and the other important function is the RecoContext_Recognition which is called when a recognition event is created.
What am i doing wrong?!?!?
Imports SpeechLib
Public Class STT_Controller
Private Recocontext As SpInProcRecoContext = New SpeechLib.SpInProcRecoContextClass 'Recognized context
Private grammar As ISpeechRecoGrammar 'Recognize Grammar
Private inputfile As New SpFileStream 'Imported file stream
Private reco As SpInprocRecognizer = New SpInprocRecognizerClass
Public ErrorNumber As Integer
Private StreamOpened As Boolean = False
Private STTResult As String = ""
Event Recognition_EndOfStream()
Event Recognition_Start()
Public ReadOnly Property ResultText()
Get
Return STTResult
End Get
End Property
Public Sub Initialise() 'Ekkinisi tis engine
On Error Resume Next
Dim reco As SpInprocRecognizer = New SpInprocRecognizerClass
If Not (Err.Number = 0) Then ErrorNumber = 704
'Event Handlers
AddHandler Recocontext.EndStream, AddressOf RecoContext_EndStream
AddHandler Recocontext.Recognition, AddressOf RecoContext_Recognition
Recocontext = reco.CreateRecoContext
If Not (Err.Number = 0) Then ErrorNumber = 701
grammar = Recocontext.CreateGrammar
If Not (Err.Number = 0) Then ErrorNumber = 702
grammar.DictationLoad()
If Not (Err.Number = 0) Then ErrorNumber = 703
End Sub
Public Sub Activate()
On Error Resume Next
grammar.DictationSetState(SpeechRuleState.SGDSActive)
If Not (Err.Number = 0) Then ErrorNumber = 801
End Sub
Public Sub Deactivate(Optional ByVal UnloadGrammar As Boolean = False)
On Error Resume Next
grammar.DictationSetState(SpeechRuleState.SGDSInactive)
If UnloadGrammar = True Then grammar.DictationUnload()
End Sub
Private Sub RecoContext_EndStream(ByVal StreamNumber As Integer, ByVal StreamPosition As Object, ByVal StreamReleased As Boolean)
RaiseEvent Recognition_EndOfStream()
Deactivate()
End Sub
Private Sub RecoContext_Recognition(ByVal StreamNumber As Integer, ByVal StreamPosition As Object, ByVal RecognitionType As SpeechLib.SpeechRecognitionType, ByVal result As SpeechLib.ISpeechRecoResult)
RaiseEvent Recognition_EndOfStream()
STTResult = result.PhraseInfo.GetText
End Sub
Public Sub OpenStream(ByVal Fname As String, ByVal mode As SpeechLib.SpeechStreamFileMode, Optional ByVal DoEv As Boolean = False)
On Error GoTo openstreamerr
If StreamOpened = True Then inputfile.Close()
inputfile.Open(Fname, mode, DoEv)
StreamOpened = True
reco.AudioInputStream = inputfile
Exit Sub
openstreamerr:
ErrorNumber = 601
End Sub
Public Sub CloseStream()
On Error GoTo CloseStreamerr
inputfile.Close()
StreamOpened = False
Exit Sub
CloseStreamerr:
ErrorNumber = 602
End Sub
End Class
May it be your fate to live in interesting times
|
|
|
|
|
Hi.
I am coding a progam where I want the Context menu to CLOSE if it is already open and you press right mouse button again.
This is something that seems VERY hard to acomplish.
The code below manages to do it 2 times, but when you right click with an open context menu the 3 time, then you get a context menu even tough I do NOT want it:
Private Sub ListView1_GetMenu(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp
ListView1.ContextMenu = Nothing
If contextIsActive = True Then SendKeys.Send("{ESC}")
' Checking the Mouse right Button
If e.Button = MouseButtons.Right Then
Try
currentItem = sender.GetItemAt(e.X, e.Y)
If Not currentItem Is Nothing And contextIsActive = False And ListView1.ContextMenu Is Nothing Then
Me.ContextMenu1.MenuItems.Add(Me.MenuItem1)
ListView1.ContextMenu = Me.ContextMenu1
ListView1.ContextMenu.Show(sender, New Point(e.X, e.Y))
contextIsActive = True
ElseIf contextIsActive = False And ListView1.ContextMenu Is Nothing Then
MenuItem1.Text = ""
Me.ContextMenu1.MenuItems.Remove(Me.MenuItem1)
ListView1.ContextMenu = Me.ContextMenu1
ListView1.ContextMenu.Show(sender, New Point(e.X, e.Y))
contextIsActive = True
Else
SendKeys.Send("{ESC}")
Me.ContextMenu1.MenuItems.Remove(Me.MenuItem1)
Me.ContextMenu1.MenuItems.Remove(Me.MenuItem2)
ListView1.ContextMenu = Nothing
contextIsActive = False
End If
Catch
Me.ListView1_GetMenu(sender, e)
End Try
End If
End Sub
Private Sub contextMenu1_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContextMenu1.Popup
If contextIsActive = False And ListView1.ContextMenu Is Nothing Then SendKeys.Send("{ESC}")
End Sub
As you can see from the code here I have LOTS of different ways for the damn context menu to close. None of which seems to work. I really REALLY need to get this to work. It HAS to work.
PLEASE help!
Anders Liden
Gothenburg Sweden
|
|
|
|