|
Could anyone help me on how to attach a calendar in a text box whereby when we click on that text box, a calendar will appear. Then if we click on the date on the calendar, it will input inside the text box.
Thanks.
|
|
|
|
|
Have you tried the DatePicker control that comes with VB6?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Yes, I've just tried that. Thanks for your response.
Rgds.
|
|
|
|
|
How do I pass a buffer of samples in the DirectSoundBuffer.WriteBuffer method under vb.net?
In the docs, the following is OK, but under vb.net the compiler complains that buf(0) can't be converted to a System.IntPtr
ds.writebuffer(0,0,buf(0),flags)
How do I write the buffer of raw samples to the directsoundsecondarybuffer8 under vb.net?
Thanks
|
|
|
|
|
The MS docs for DirectSoundBuffer.WriteBuffer say tht a typical call looks like:
dsBuf.WriteBuffer(0, 0, buf(0), CONST_DSBLOCKFLAGS.DSBLOCK_ENTIREBUFFER)
where buf(0) is the first element of an array of bytes. However, this fails the .net compiler which says the third parameter must be a System.IntPtr, and that it can't convert a value of type BYTE to a IntPtr.
What is happing here? This is for a DirectSound8 app.
-Davivd
|
|
|
|
|
Convert the third parameter to Intptr using CType
as follows
dsBuf.WriteBuffer(0, 0, buf(0),CType(CONST_DSBLOCKFLAGS.DSBLOCK_ENTIREBUFFER,System.IntPtr))
|
|
|
|
|
Where to find the icons used in the IE 6.0 toolbar?
|
|
|
|
|
www.vbaccelerator.com and check out the icons section
|
|
|
|
|
How can you detect Windows events like when Windows shuts down?
|
|
|
|
|
Here's one possible starting point:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconsubscribingtoandconsumingmanagementevents.asp
|
|
|
|
|
I've got a bunch of check boxes that all do the same piece of code except for one word. If the check box is checked they run:
command = "net send " checkbox.caption & txtBox.text
the checkbox.caption needs to equal the caption of the check box if it's checked.
I was thinking about using control arrays and doing something like this:
For Each value In Checkbox(x)
command = "net send " checkbox.caption & txtBox.text
Next
HELP
|
|
|
|
|
If you absolutely have to store your commands in the Caption property of your checkboxes, you could do something like this:
For i = 1 To Check1().UBound + 1
Debug.Print Check1(i - 1).Caption & ":" & CStr(Check1(i - 1).Value)
If Check1(i -1).Value = 1 Then
commandLine = "net send " & Check1(i - 1).Caption
End If
Next
|
|
|
|
|
I have a VB.net Application ,whenever i click on the EXE a new instance of the application runs .But i want one instance to run at a time .That means if the exe is already running by clicking on it it should show the message that it is already running.
Similar case for loading forms.suppose i have a button ,clicking on it a form is comes up ,if i click on the button several instance of the same form is running ,how to get rid of this that means there must be one instance of a form at a time.
Please help me its urgent
|
|
|
|
|
Use a Mutex - so you are going to have to look at the Win32 API.
Have a look at CreateMutex - to make a named Mutex. You can only create a Mutex once across processes, so the if a second instance launches and tries to create it, there will be an error, which can be caught. So you would put this routine in the start up code.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
See my reply to the original message. There is a System.Threading.Mutex class available in the Fx.
|
|
|
|
|
|
Interesting questions! For the single app instance, try using a Mutex:
Sub Main()
Dim M1 As System.Threading.Mutex
Dim createdNew As Boolean = False
M1 = New System.Threading.Mutex(True, "MyUniqueMutexName", createdNew)
If createdNew = False Then
MsgBox("Other process is running")
Return
End If
Application.Run(New Form1())
End Sub
For single form intance, this is a bit of a hack, but it works. The problem with maintaining a member-level ref to a form occurs after the form has been closed. At this point the form is disposed, but we have no way of determining the disposed state by examining the ref (that I know of). My hack catches an ObjectDisposedException as a way of determining the disposed state. You could also subclass Form, override Dispose(bool) and provide an IsDisposed property.
' Member-level reference
Private _Form2 As Form2
...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If _Form2 Is Nothing Then _Form2 = New Form2()
Try
_Form2.Show()
_Form2.BringToFront()
Catch ex As ObjectDisposedException
_Form2 = New Form2()
_Form2.Show()
End Try
End Sub
|
|
|
|
|
thanx CBoland
Its great and working as per my expectation.
Thanx a lot
Pradipta
|
|
|
|
|
This will work for detecting an instance of the application already running.
If (UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0) Then<br />
'//End The App Or Whatever You Want To Do Here<br />
End If<br />
|
|
|
|
|
Hello all,
How can I retreive the long file name form a short file name in VB6 in WinNT 4.0. Using GetLongPathName won't do as this is Win2000 and above API.
Thanks in advance
Alberto Gattegno
Software Engineer
http://www.itgil.com
|
|
|
|
|
Good people,
How do I set the “Comment” attribute of a file or folder using VB script ?
For example, the following code lists “Comment” attributes for files under C:\ directory:
set shell = CreateObject("Shell.Application")
set folder = shell.namespace("C:\")
for each folderitem in folder.items
list = list & _
folder.GetDetailsOf(folderitem , 0) & ", " & _
folder.GetDetailsOf(0, 5) & ": " & _
folder.GetDetailsOf(folderitem, 5) & vbCr
next
MsgBox list
Thanks,
Serge
|
|
|
|
|
Hello!
I'm have an Access database (mdb) with table 'Table' with 2 columns (fields): 'fieldA' and 'fieldB' (for example).
The question is how to add new column (field) 'fieldC' progamatically (when my program is running).
I'm use OleDB to open this database.
If you know how to do this - please answer (please with example). May be I'm must use AboDB (not good for me) or AdoDX or something else.
Thank you!
Code
|
|
|
|
|
I have a .NET DLL that contains two forms. This DLL works great from windows applications. But when I make a windows service that references the DLL the forms do not show, the form code executes without any errors but no forms are displayed. Does anyone know how to get this to work?
|
|
|
|
|
I could be mistaken on this, but normally a service does not have any user interface, and the service framework may, in fact, prohibit any UI from displaying properly... though I would expect it throw an error in that case. If you want to run the code as a service, separate the UI and the logic into separate assemblies, then use the UI as an observer of the state of the service?
|
|
|
|
|
OK. In general:
Windows Services run in their own Windows sessions. What does this mean? Well, when you login to Windows, you start your own session. Services do the same thing. They get their own Window Station, Desktop, Environment, and such. This means that the user interface your app is putting is showing up, but it's on a desktop that you can't see.
There is no way to view the session of a service! Services cannot interact with the user session directly (or easily.) But, it IS possible to write a service that interacts with the users desktop. Your going to have to supply the service with the logged on users security context, station handle, and desktop handle, at a minimum. Hint: Your going to have to write a seperate app that runs on the user side and communicates with the service via RPC to do this.
Information on how this works (and why) can be found in the Platform SDK documentation. Just search for "Window Stations" (no S on the end of Window) on MSDN for a good starting point.
RageInTheMachine9532
|
|
|
|