|
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
|
|
|
|
|
Hello Anders
I was wondering if you ever got an answer to your above question. I am having the same problem. If so could you post your resolution.
Thanks
"The things that will destroy us are: politics without principle; pleasure without conscience; wealth without work; knowledge without character; business without morality; science without humanity; and worship without sacrifice."
-Mahatma Gandhi (1869-1948)
|
|
|
|
|
Hi everybody. I got a simple question about loading a DLL in a VB 6 (or .NET) Application. This doesn't seem to work right. I am trying to find some way of loading a DLL without specifying the full path and without the DLL being located in the \Windows folder. For example when you have the DLL in the same folder with the Application. I tried only specifying the DLL like:
Public Declare Function SomeFunction "Somedll.dll" () as Long.
This doesn't work. Probably it looks for it in the Windows folder. As I read in the MSDN documentation it should look for it first in the Application folder, but this doesn't happen as it seems.... To complicate thing worst, I can't specify the path for the Application right there because I get a compilation error:
Public Declare Function SomeFunction App.Path & "\Somedll.dll" () as Long. '-----> This doesn't work.
I saw this in a book:
Public Declare Function SomeFunction ".\SomeFolder\Somedll.dll" () as Long.
So I tried:
Public Declare Function SomeFunction ".\Somedll.dll" () as Long.
This ain't workin' either. Anybody got a clue? : )
Thanks! : )
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
You'll never get it to work this way because it's a compile-time only declaration. It can't be modified at run-time.
I wish I could tell you more but I just got called out of the office... Sorry!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave : ). There's no rush for me right now.... I was just wondering if I could link directly to a DLL in my Application's folder, rather than storing it in the Windows folder. It seems that I will be forced to save it in the Windows folder... but even so, how can I know where will the future users of my Application have their Windows folder? I mean, there's no guarantee that VB will find the DLL if I put it there right??
Anyway... what do you think about this piece of code? I found it in a book about Hooks and Subclassing in Visual Basic...
Public Declare Function SomeFunction ".\SomeFolder\Somedll.dll" () as Long.
What does that path mean? That the "somedll.dll" file is located in the SomeFolder subfolder of Windows or of the Application?
Thank you.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hello everybody. I'm trying to make the contents of a textbox, if they don't fit in a page to wrap and use the line underneath etc etc.
So far i can clip the string in the given rectangle i have indicate with the setclip command. Other than that i can't make it work. Here is a part of the code:
'Create string to draw.
Dim drawString As String = txtComment.Text
Dim drawString1 As String = imageToLoad
Dim drawFont As New Font("Arial", 0.4, FontStyle.Regular, GraphicsUnit.Millimeter)
Dim drawFont1 As New Font("Arial", 0.6, FontStyle.Regular, GraphicsUnit.Millimeter)
Dim drawBrush As New SolidBrush(Color.Black)
' print filename
Dim drawPoint As New PointF(0.0F, -27.0F)
'print comments
Dim drawPoint1 As New PointF(0.0F, 90.0F)
If chkComment.Checked = True Then
e.Graphics.SetClip(New Rectangle(0, 0, 100, 100))
e.Graphics.DrawString(drawString, drawFont1, drawBrush, drawPoint1)
End If
e.Graphics.DrawString(drawString1, drawFont, drawBrush, drawPoint)
' There are no more pages.
e.HasMorePages = False
The textbox in question is the txtComment.Text. Any help please?
Thank you
Still trying to find the way
|
|
|
|
|
If you use the DrawString variant that takes a Rectangle, it will wrap the string for you.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thank you Christian. I used
Dim LayoutRen As RectangleF = New RectangleF(0, 90, 100, 300)
e.Graphics.DrawString(drawString, drawFont1, drawBrush, LayoutRen)
and it work like a charm. Thank again!
Still trying to find the way
|
|
|
|
|
Is there a easy way of saving the state of the TreeView. When you add or delete a node in the TreeView, It collapses the nodes which I don't want.
Thanks
|
|
|
|