|
A function that will format the file part number based off format code.
|
|
|
|
|
Which means what? Geez - You're not helping much are you. You need to help us to help you. Explain what you want to happen.
|
|
|
|
|
That doesn't mean anything. The file get's it's format when you write it and how you write it. I still have have a clue what you're trying to do.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
How to show Tooltips for a control when it’s disabled?
Thanks
|
|
|
|
|
IIRC, ToolTips are disabled along with the control. I don't know of a method to get around this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dear All,
I have a problem, I have a DLL that runs a Recieve Thread for USB communications. I am calling the DLL from VB 2005. It all works (openUSBComms function, and recieve data using a Callback). However When I call the closeUSBComms function from the FORM CLOSING event my program hangs.
In side the DLL, the Close Functions Sets a 'Death' Event and Waits for the Thread to terminate using WaitForSingleOject.
When I call the dll closeUSBComms funciton from a Button event say, all is well and the Thread Terminates, But when I call it from the Closing Event of the Form the WaitForSingleObject doesn't return and the Thead doesn't terminate.
Any Ideas why ?
I have access to both the VB and the DLL source code and can change either. But preferably not the DLL unless really have to.
Adrian
|
|
|
|
|
Hi Everybody,
i have created the project in VB.Net using visual Studio 2005.But when i try to run in setup file in client it asks to install .net framework 2.0.
So how to automatically intall the .net framework 2.0 at the time of run my project setup wihout user interaction
Thanks for Advance Help
|
|
|
|
|
|
HI there,
can any one suggest how to convert an image to a pdf document.I have tried the third party dll's but every one is an evolution version. please guide me on how to do it....
-regards
GRK
|
|
|
|
|
Check this[^]
/"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
I want to have the code to explaint voices and imagines throght LAN and wireless, the Source Code is written by VB.Net. I wish to have the help, please send to email cayoaihuong84@yahoo.com
i am pham quang dan
|
|
|
|
|
I have no idea what you are asking for.
pham quang dan wrote: the code to explaint voices and imagines throght LAN and wireless
What Images and Voices?
|
|
|
|
|
Is there a way to get the radio button that is checked? i have many radio buttons and as we all know only 1 radio button can be selected all any one time. My question is how can i get the name of the radiobutton that the user select and save it into the database? wat should i type? Urgent... Thanks
|
|
|
|
|
I think the easiest way would be to create a module level string variable and assign a value to it on the radio buttons CheckChanged event, e.g.
Dim strValue As String
Private Sub radButton_CheckChanged(...) Handles radButton.CheckChanged
If radButton.Checked = True
strValue = radButton.Text 'or whatever value it is the you want
End If
End Sub
|
|
|
|
|
ok.. understood.. thanks a lot
|
|
|
|
|
u can use " foreach "
<big> foreach a as control in form1.controls<br />
if a.gettype="RadioButton" then<br />
return a.name<br />
end if<br />
next</big>
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
I have windows form (vb.net) in which i have webbrowser control. Now when i open up some web site at runtime in that form, i need to capture the onblur and onfocus events of my input boxes on an html form and perform custom external handling in my vb.net application. I have been able to successfully hook up a handler to the 'onclick' event, but the 'onblur' events are not working. Can anybody please tell me why is it happening?
i have picked up an input box and then attaching an evenhandler using
AddHandler CType(txt, mshtml.HTMLInputTextElementEvents2_Event).onblur, AddressOf Me.txt2_HTMLInputTextElementEvents_Event_onblur
and the correspoding handler is like this.
Private Sub txt2_HTMLInputTextElementEvents_Event_onblur(ByVal pEvtObj As mshtml.IHTMLEventObj)
.....................
........some code will go here .......
.....................
End Sub
|
|
|
|
|
I am working on a program that displays Physical, Virtual, and Combined memory amounts both in Totals and Available results, and I wish to have the options to display in "KB", "MB", or "GB". Ok, this is simple enough and I have the physical memory displaying just fine. However I am having trouble displaying the Virtual Memory properly, I know that my machine has 3072 MB set but I am getting some very wild return figures using this code:
mVirtualMemory = My.Computer.Info.TotalVirtualMemory
to display in KB I use the following method that I use for Physical Memory:
mVirtualMemory = My.Computer.Info.TotalVirtualMemory
mVirtualMemory = mVirtualMemory / 1024
Return mVirtualMemory
However I am getting this: mVirtualMemory = 8589934464
I do not understand what I am doing wrong, please help!
DB_Cooper1950
"Life is like a box of..."
|
|
|
|
|
What did you define mVirtualMemory as? What's the return type on this function you created? The value returned by TotalVirtualMemory is an Unsigned Long (ULong), or a 64-bit unsigned integer. If the types you're using are smaller, like using 32-bit Integers, you can get some unexpected results.
Public Function GetTotalVMSizeInKb() As ULong
Dim x As ULong = My.Computer.Info.TotalVirtualMemory
Return (x / 1024)
End Function
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave,
Thank you for your reply, below is the full Property that I used in the class.
Public ReadOnly Property VirtualMemory() As ULong
Get
mVirtualMemory = My.Computer.Info.TotalVirtualMemory
mVirtualMemory = mVirtualMemory / 1024
Return mVirtualMemory
End Get
End Property
DB_Cooper1950
"Life is like a box of..."
|
|
|
|
|
You didn't specify what mVirtualMemory was before you used it, so it defaulted to an Integer type. Change it to this and it should work:
Public ReadOnly Property VirtualMemory() As ULong
Get
Dim vVirtualMemory As ULong = My.Computer.Info.TotalVirtualMemory
Return (mVirtualMemory / 1024)
End Get
End Property
Or, you can just avoid the entire variable declaration thing altogether and do this:
Public ReadOnly Property VirtualMemory() As ULong
Get
Return (My.Computer.Info.TotalVirtualMemory / 1024)
End Get
End Property
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Dave Kreskowiak wrote:</div>You didn't specify what mVirtualMemory was before you used it, so it defaulted to an Integer type. Change it to this and it should work:</blockquote>
Dave,
Actually I did declare the variable mVirtualMemory as shown below. I just did not include this in the last entry.
...
Private mVirtualMemory As ULong
...
After that is when I used it here...
<code>
Public ReadOnly Property VirtualMemory() As ULong
Get
mVirtualMemory = My.Computer.Info.TotalVirtualMemory
mVirtualMemory = mVirtualMemory / 1024
Return mVirtualMemory
End Get
End Property
</code>
mVirtualMemory as you see is declared as a private ULong variable in the class that I wrote. So do you see anywhere else that I made a mistake?
Thank you.
DB_Cooper1950
"Life is like a box of..."
|
|
|
|
|
Nope. No other mistakes, save the only other one is your assuming you have a complete understanding of virtual memory under Windows. It's entirely possible to have this much "Virtual Memory", depending on your systems configuration. TotalVirtualMemory does NOT equal pagefile size!
Oh! And using a "global" variable like this (mVirtualMemory) is really bad practice! You're violating rules of Encapsulation and making it harder to debug your code. There is no reason, that I can see, for having that variable declared in Class scope. It should have been done inside the Property code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: Oh! And using a "global" variable like this (mVirtualMemory) is really bad practice! You're violating rules of Encapsulation and making it harder to debug your code. There is no reason, that I can see, for having that variable declared in Class scope. It should have been done inside the Property code.
Dave,
Please take a look at the following and then let me know that it is "Bad Practice", when the variable is used elsewhere in the class...
Public Class SystemMemory
#Region "Variables..."
Private mPhysicalMemory As Long
Private mVirtualMemory As ULong
Private mCombinedMemory As Long
Private mAvailablePhysicalMemory As Long
Private mAvailableVirtualMemory As ULong
Private mAvailableCombinedMemory As Long
Private mInstance As SystemMemory
Private mPctPhysicalMemory As Integer
Private mPctVirtualMemory As Integer
Private mPctCombinedMemory As Integer
#End Region
#Region "Constructors and Destructors..."
Public Sub New()
mInstance = Me
End Sub
Protected Overrides Sub Finalize()
mInstance = Nothing
End Sub
#End Region
#Region "Main Body in KB's..."
Public ReadOnly Property PhysicalMemory() As Long
Get
mPhysicalMemory = My.Computer.Info.TotalPhysicalMemory
mPhysicalMemory =(mPhysicalMemory / 1024)
Return mPhysicalMemory
End Get
End Property
Public ReadOnly Property VirtualMemory() As ULong
Get
mVirtualMemory = My.Computer.Info.TotalVirtualMemory
mVirtualMemory = mVirtualMemory / 1024
Return mVirtualMemory
End Get
End Property
Public ReadOnly Property CombinedMemory() As Long
Get
mCombinedMemory = (mPhysicalMemory + mVirtualMemory)
Return mCombinedMemory
End Get
End Property
....
I did not list where it is used elsewhere, but it is not just used inside the property call as the other private variables are also used elsewhere. Is is incorrect to call and use them in that manner?
DB_Cooper1950
"Life is like a box of..."
|
|
|
|
|
It is! Watch what happens when I get rid of all the class-scoped variables:
Public Class SystemMemory
' Say "Bye-Bye" to all the class-scoped variables! From what I can see in your code,
' you don't need a single one of them.
' I have no idea what you're doing with this stuff, but if the rest of this
' class is like your properties, you can get rid of this entire Region.
#Region "Constructors and Destructors..."
Public Sub New()
mInstance = Me
End Sub
Protected Overrides Sub Finalize()
mInstance = Nothing
End Sub
#End Region
#Region "Main Body in KB's..."
Public ReadOnly Property PhysicalMemory() As Long
Get
Return My.Computer.Info.TotalPhysicalMemory / 1024
End Get
End Property
Public ReadOnly Property VirtualMemory() As ULong
Get
Retrun My.Computer.Info.TotalVirtualMemory / 1024
End Get
End Property
Public ReadOnly Property CombinedMemory() As Long
' You can call your classes properties from inside
' the same class
Get
Return PhysicalMemory + VirtualMemory
End Get
End Property
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|