|
Hi all,
I draw a rectangle. Now I want, that rectangle changes the color, when mouse over it.
I want to have an event when mouse is over rectangle, and NOT track all mouse moves.
Is it possible? I just can't find a good way to do it?
Thanks a lot,
Boni
|
|
|
|
|
Sure, but you will have to track the mouse movement, if you think about it, if you didn't track the mouse movement it wouldn't be very effective. Assuming your class has a Rectangle object (i.e., rect in the example), within your MouseMove eventhandler you could say:
If rect.Contains(Cursor.Position) Then
'change your color here, you are inside the rectangle
End If
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi Nick,
thank you so much for the answer. But can't windows notify me with an event, when the mouse is over my rectangle? (I could imagine to register the rectangles "contain"-method somewhere(?)) I fear, that if track mouse for all of my 1000 objects (not only rectangles but even more complicated figures) for each move this will slow down the PC very much.
Thanks for your time,
boni
|
|
|
|
|
I’m about ready to complete my first program, thanks to a lot of you and your help!
I have no idea how to create an installation program though. I want to create an installation program that will:
1-check for certain directories and create them if they are not available
2-install the latest version of the dotnet framework
3-and, of course, install my application.
Can anybody offer any good resources or suggestions?
Thanks
Brad
|
|
|
|
|
To create installation programs, we need to add Setup or Web Setup projects to the solution and manage all the things like directories etc on the target machine.
You will find lot of information on deployment on MSDN
Bhaskara
|
|
|
|
|
You can use install shield to package your project and make a setup file. Read the help file for more help, or run its wizard two or three time for test it.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Thanks for your suggestions. I’ll check them out.
Brad
|
|
|
|
|
I found a great installation program called GP-Install[^].
I’m sure that this application lacks a lot of the functionality that you get from Install Shield but it worked perfect for my needs and, best of all, it's free.
Thanks
Brad
|
|
|
|
|
Can you explain me why do we need Optional arguments?And what are ParamArray Arguments?
|
|
|
|
|
You will use optional parameters and paramarray when you want to create a method which takes 'n' number of arguments
for more into refer MSDN
Bhaskara
|
|
|
|
|
What is the difference between ByRef and ByVal.Please answer me as clearly a spossible cause Im a beginner and I want to deeply understand the cases when we use the one and the other.Thank you.
|
|
|
|
|
dear
ByRef thats mean the parameter take a vlaue in method and after the method end run, the value still there and if you call the method another one the last value is the initial value to the method.
but ByVal that means the value discared its value after the run end and take the standard initial value when you call the method a gain
regards
Palestine Guy
|
|
|
|
|
My first post to the code project... I am developing an application that will run on a Windows CE device using the Compact Framework provided with VB.NET.
I have developed a class that inherits from PropertyDescriptor. When I call the PropertyDescriptor constructor from my inherited class and provide an existing PropertyDescriptor object I get "An unhandled exception of type 'System.NullReferenceException' occurred in System.dll".
Has anyone else seen this problem? Suggestions?
Thanks a lot!
Kurtis
|
|
|
|
|
Well, for one, this question really belongs in the Embedded/Mobile forum. Second, without seeing your code where the problem occurs, it's impossible to tell you what your doing wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
is one better then the other?
i like select case better then if....then...elseif...else...end if
but im not sure really what im missing out on if anything by not using the if statment
thank
foolish
|
|
|
|
|
Switch/Cases accept only primitive data types, such as byte, short, char, int.
If you are checking for a string, a case becomes much more complicated to use.
It is better to use a Switch/Case when you are dealing with options, where you can associate each option with a Letter or Number.
If statements should be used when more complex comparisons are made, and can be grouped using the AND/OR keywords.
|
|
|
|
|
Hey Guys
I am trying to Bulk Insert a Text file into an SQL DB through VB6. I have never used this Object Model before so any help would be appreciated.
I have this code from MSDN but cant seem to implement it??
-----------------------------
'initialize Payroll table in DTS_UE db with bulk data
Dim objPackage As DTS.Package2
Dim objConnect As DTS.Connection2
Dim objStep As DTS.Step
Dim objTask As DTS.Task
Dim objBulkCopy As DTS.BulkInsertTask
On Error GoTo Handler
Set objPackage = New DTS.Package
'create database connection
Set objConnect = objPackage.Connections.New("SQLOLEDB.1")
With objConnect
.ID = 1
.DataSource = "(Local)"
.UseTrustedConnection = True
End With
objPackage.Connections.Add objConnect
'create step and task, specify data file and format
Set objStep = objPackage.Steps.New
Set objTask = objPackage.Tasks.New("DTSBulkInsertTask")
Set objBulkCopy = objTask.CustomTask
With objBulkCopy
.Name = "BulkInsTask"
.DataFile = "C:\Development\Bulk Insert\TEST.txt"
.ConnectionID = 1
.DestinationTableName = "BULK_INSERT_TEST..BI_Test"
.FieldTerminator = "-t"
.RowTerminator = "\n"
End With
'link step to task to package, run package
objStep.TaskName = objBulkCopy.Name
objStep.Name = "BulkInsStep"
With objPackage
.Steps.Add objStep
.Tasks.Add objTask
.FailOnError = True
.Execute
End With
|
|
|
|
|
hi all
i want to know how to load a form from another one by vb.net
by vb6 it was form2.visible=true
i tried it but it make error
Lost & Forgotten
|
|
|
|
|
Well you do as follows depending on scenario
just to show dialog
dim myform as new form2
myform.showdialog
|
|
|
|
|
dear
try to do this things
Me.hide()
Me.yourFormName.ShowDialog()
regards
Palestine Guy
|
|
|
|
|
Hello Everybody,
This is my first ActiveX control. I am desinging this control in VB6.0
I design 2 ActiveX Contrls One is Vertical Toolbar & second is Horizontal Toolbar.
I desing both of them. requirement of project is whenever user click on button of Vertical toolbar, Horizontal Toolbar will be created & displayed at position adjacent to clicked button.
(I think you got Problem Statement of project)
Now problem is whenever I am tying to create instance of my Horizontal Activex in Verical Activex control's Click event. Vb fired run time error on following SET statement
Public Withevents obj as HorizontalToolbar
Set obj = Controls.add("CntHori.TbrHorizontal","obj1")
Here CntHori is Lib name & TbrHorizontal is Control name.
Error name is ---> Obj not SET.
I try in this way assuming thta above code will create flyout Horizontal Toolbar on users form. Is there any different way to design flyout toolbar / control in VB.
Second Difficulty is when user move his form (during run time) how to get position of my placed Vertical Toolbar or user form's (Left,Top) so that i can move my flyout toolbar.
I think all of you get my difficulty.
If ther is any better way do this please tell me.
Your Suggetions Are most valueable for me. Deadline of project is 2 day only
Please Help Me.
|
|
|
|
|
Hi, i have a problem while clean the virus from my computer. My computer infect with the virus but I don't know the virus name. I try to access the registry but it seem that the virus has control the process of my PC. I want to view the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
but the registry is quit when I open it. Does any one know how to write the code in vb6 or vb.net to list the content of the registry into the listbox?
Need help urgent
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
You'll be muich better served by a virus scanner than wasting time writing this yourself. Chances are you won't find the virus being launched from the most obvious place in the registry to do so.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The most importance thing is checking the name of the virus. My computer at workplace are affect with the virus. I try to load anti-virus to scan it but an anti-virus is stop functionning. Everytime that I used to clean the virus is checking for the virus name and find the specific method to clean it (i read symantec documentation). I cannot use FixTool to clean it because fixtool is clean for one type of virus, so I need to check the name in the registry (i forgot to tell you, when i open registry editor it is close again). So that is why i need to check the content of the registry from the specific location (especially: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run) and find the name of the key parameter that virus drop, then I will know the name of the virus and the specific FixTool and method to clean it.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Roath Kanel wrote:
So that is why i need to check the content of the registry from the specific location (especially: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run) and find the name of the key parameter that virus drop, then I will know the name of the virus and the specific FixTool and method to clean it.
Like I said, you finding the virus running from this key is very rare. Don't expect to find the name just sitting in the open like you expect. Anyway, here's the example of what you're looking for. This assumes there is a Button on your form and a ListView setup for Detail mode....Good Luck!
Imports Microsoft.Win32
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub btnReadRunKey_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReadRunKey.Click
Dim regKey As RegistryKey
Dim keyValue As String = "Software\\Microsoft\\Windows\\CurrentVersion\\Run"
regKey = Registry.LocalMachine.OpenSubKey(keyValue, False)
Dim regNames As String() = regKey.GetValueNames()
For Index As Integer = 0 To regNames.GetUpperBound(0)
Dim newItem As ListViewItem
newItem = ListView1.Items.Add(regNames(Index))
newItem.SubItems.Add(regKey.GetValue(regNames(Index), "*** NO VALUE ***"))
Next
regKey.Close()
End Sub
End Class
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|