|
Use a parameterized constructor:
Public Class Car<br />
<br />
Private Color as String<br />
<br />
Public Sub New()<br />
'default constructor<br />
End Sub<br />
<br />
Public Sub New(colName as String)<br />
'parameterized constructor<br />
Me.Color = colName<br />
End Sub<br />
<br />
End Class
Do a Google search on Constructors for more information.
|
|
|
|
|
Hi guys,
Can someone help me? I need to open a temporary text file and put some numbers in it for another app to read.
This third-party app will delete my temporary file upon reading it.
The trick is, how do I stop him from deleting my file until I finish writing the complete number? Is there anyway I can "lock" until i use FileClose() command?
Please adivise...
Thanks...
|
|
|
|
|
The FileOpen() method should set the OpenShare parameter to OpenShare.LockReadWrite by default so other processes cannot delete the file before the FileClose().
From .NET help:
Public Sub FileOpen( _<br />
ByVal FileNumber As Integer, _<br />
ByVal FileName As String, _<br />
ByVal Mode As OpenMode, _<br />
Optional ByVal Access As OpenAccess = OpenAccess.Default, _<br />
Optional ByVal Share As OpenShare = OpenShare.Default, _<br />
Optional ByVal RecordLength As Integer = -1 _<br />
)
e.g.
<br />
FileOpen(1, "TESTFILE", OpenMode.Output, OpenAccess.Write, _<br />
OpenShare.LockReadWrite)
Are you opening and closing the file only once, or after each number is written?
...Steve
|
|
|
|
|
hi i need motion detection program in visual basic 6
i need program motion detection from webcam and
motion detection from my tv card
|
|
|
|
|
Sorry, we don't just give a completed apps away here.
The mission here at CP is to help you with code you write.
Try Google if you're looking for complete apps -> "vb6 motion detection"[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This is going to sound stupid to you, but iv'e only just started programming (a few hours ago, just playing around, no books)
anyway,
I'm trying to change the enabled property of a textbox when there is input,
I'm using the following, and the enabled property of the button is set to false at design time.
<code>Private Sub btnlogin_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.EnabledChanged
If txtpassword.Text = "" Then
btnlogin.Enabled = False
Else
btnlogin.Enabled = True
End If</code>
Please help me
Thanks
|
|
|
|
|
Hi,
Guess you should use the use the textchanged on the textbox setting the enable property on the btnlogin instead of using the enabledchanged on the button, as this would require the button property to change before the code is executed
Cheers
DJ
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
"I'm trying to change the enabled property of a textbox when there is input"...???
Private Sub txtpassword_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If txtpassword.Text = "" Then
btnlogin.Enabled = False
Else
btnlogin.Enabled = True
End If
End Sub
|
|
|
|
|
Thanks. That worked great
|
|
|
|
|
Hi,
I am looking for some way that you can drag and drop a columnheader and create a group based on that. I know there is a lot of third party software doing this, but they more or less all look the same, so I am wondering whether this is somekind of standard feature provided by the grid or that it is realy simple to code. Normally I would find something about this in the articles section as it is a quite common feature, but i couldn't find anything there. Any suggestions?
Cheers
DJ
Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
|
|
|
|
|
hello anyONE,
Can any body tell me how to set parameter value from vb.net code of cr9, the value exist in a text box named txtName
FIRE
|
|
|
|
|
|
how to make a variable that in every hour it makes + 1 in this variable?? ex: now it is 5 pm and in my var there is a number 6. that when 6.pm comes it makes + 1 to var so that it will be num 7. how can i make this??
|
|
|
|
|
Use timer control to do that
1-add timer component
2-set enabled to true
3-set interval to hour 1000 ms=second
in tick event increment the variable
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i = i + 1
Me.Text = i.ToString()
End Sub
MCAD
|
|
|
|
|
Hi
I need to remove the icon of AN OTHER APPLICATION from the system tray. Is it possible?
Thanks
|
|
|
|
|
Nope. You can't get to it because your app doesn't own it. Besides, you'll only cause the other application to crash. The only way to remove the icon is to shutdown the other app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello there
I have one thread running parallel to main application. the problem is it takes 100% CPU Usage and I want to assign it say 10 % of the CPU so that in any case system should not go slow.
Can any one guide me how to allocate % CPU Resource to any particular thread. or doing same thing with any application ike MyApplication.exe will take only 10% of the CPU Resource.
|
|
|
|
|
|
|
Hi,
Have you found a solution ?
In Folding@Home you can set max cpu usage in %, but no one has been able to tell me how this is done in vb.net.
|
|
|
|
|
|
I need to do a simple button select from a form to call a MS Word document and a PDF document. I'm new to DotNet so be nice.
|
|
|
|
|
If you just need to open a document, you can simply shell out the command using a commandline similar to this:
Shell("C:\Program Files\Microsoft Office\Office\WINWORD.EXE <mydocument.doc>")
The document must be fully qualified with it's path i.e. "C:\MyDocument.doc" or whatever.
You can do the same for a PDF.
If you need to actually interact with the document, you will have to use the Word Automation model, and your application MUST be compiled against the same version of Word the user has.
Similarly, if you need to interact with a PDF file you will need a full version of Adobe, not just the free reader, and you will have to program against the Adobe API library.
Robert
|
|
|
|
|
I can create a new instance for the MS Office app with the shell statement:
Shell("C:\Program Files\Microsoft Office\Office11\WINWORD.EXE ")
but I can not figure out the proper syntax to call a specific word document in a folder. I have tried the double, triple quotes...
Shell("c:\Documents and Settings\Administrator\My Documents\Docs\Analysis.doc")
I still get file not found in my try catch block
|
|
|
|
|
i am having a problem with the time. i want to see how many hours there were between the first time and the current time. I am making a bit bit game and i want to check the last time that the pet was fed and the distance in hours from that time till current time. i am having a problem with the datediff because if a day passed away, the hours will begin again or with a negative sign before the number. how can i make it that it will keep going on the numbers now restarting on a date.?
|
|
|
|