|
I've posted my source code[^] I'm hoping this is what your looking for and there's a ton of room for improvements.
Good luck. Tell me how it turns out.
|
|
|
|
|
Thx for helping
and hope ur doing good in 'Jury Duty'
isnt far away for Computer things...
Error Oppening the solution
'CreateEllispes AreJay code project\textmessenging\bmpregion\bmpregion.csproj is not installed
any way i will see the code
will let u know what will happen
any prob to get ur personnal Email (Msn...)?
Regards
Ramy
|
|
|
|
|
Go directly to the EllipsePilot.vbproj instead of the .sln
bmpregion.dll <- this a dll created by Weiye Chen here on CP
has been added as a reference.
EllipsePilot <- has a MapParker Class and simple example on how-to
|
|
|
|
|
Everything is working fine now
didnt use the DLL until now
THX
-- modified at 16:07 Wednesday 20th December, 2006
Regards
Ramy
|
|
|
|
|
Hello,
Having a map
I want to know if the user has clicked outside or inside the borders of the map
Note that: the image containing the map is chosen as background of the form
So I thought of something
I have drawn the map with the following
RGB =255,255,255 outside the borders
RGB=254,254,254 inside the border
please take a look at this
Dim img1 As Bitmap<br />
Private Sub frmmap1_Load()<br />
img1 = New Bitmap("images\map.jpg", True)<br />
End Sub<br />
Private Sub frmmap1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick<br />
If (img1.GetPixel(e.Location.X, e.Location.Y).R = 255 Then<br />
MsgBox("out")<br />
<br />
Else<br />
MsgBox("in")<br />
End if<br />
End sub
But I m facing problems with that (because the size of img1 is not the same as background of the form
Can I do the same test directly on the background of the form without loading img1-or can i set the image size as the size of the background of the form?
Or is there any other way of thinkin
Happy Holidays
Regards
Ramy
|
|
|
|
|
|
ramy.zip[^]
Made a few adjustments to the application:
1. Move the background image to a Panel to keep the click event on the image only.
2. Added a gray background to the image.
3. Added a true white (ffffff) to the map's selectable area.
Great idea on cloning the background and comparing the pixel colors!
I'm listening but I only speak GEEK.
|
|
|
|
|
thx four help (especially with photoshop thing...)
I would like your help with the following
having drawn an ellipse on a specific location with the code that you have previously provided me,
i would like to have control on that ellipse, means when pressing on the drwan ellipse(mouse Hover) (do action....)
if you refer to the first code you gave me to mark ellipse on map
i found the following code in the DLL of 'Weiye Chen'
else if(control is System.Windows.Forms.Button)<br />
{<br />
Button button = (Button)control;<br />
<br />
button.Text = "";<br />
<br />
button.Cursor = Cursors.Hand;<br />
<br />
<br />
----<br /> Dont know how to benifit from the above code using vb.net 2005
note : i m not using that DLL
do u have any hint for me
Happy New Year
Regards
Ramy
|
|
|
|
|
Change the Panel Control to a Button then dynamic assign names, text and events.
I'm listening but I only speak GEEK.
|
|
|
|
|
AreJay wrote: Change the Panel Control to a Button then dynamic assign names, text and events.
You mean change the ellipse to a button ?
(note: i have many ellipses on the map..)
any help for that?
Regards
Ramy
|
|
|
|
|
hey...
plz answer me ASAP .
coz my project dead line is soon,
all what i want is to let the user click on the drwan ellipse....
thx
Regards
Ramy
|
|
|
|
|
Change the forms MouseClick Event to:
<br />
<span style="color: #0000FF">Private Sub</span> Form1_MouseClick(<span style="color: #0000FF">ByVal</span> sender <span style="color: #0000FF">As Object</span>, <span style="color: #0000FF">ByVal</span> e <span style="color: #0000FF">As System.Windows.Forms.MouseEventArgs</span>) <span style="color: #0000FF">Handles</span> <span style="color: #0000FF">Me</span>.MouseClick</p><br />
<div style="padding-left:10px; "><br />
<span style="color: #009900">' only on the left mouse button</span><br /><br />
<span style="color: #0000FF">If </span>e.Button = Windows.Forms.MouseButtons.Left <span style="color: #0000FF">Then</span><br />
<div style="padding-left:10px; "><br />
<span style="color: #009900">' new instance of random to spice up the pilot</span><br /><br />
rand = <span style="color: #0000FF">New</span> Random()<br /><br />
<span style="color: #009900">' Creating a new instance of the MapMarker Class<br /><br />
' passing a randomly generated color </span><br /><br />
mm = <span style="color: #0000FF">New</span> MapMarker(Color.FromArgb(rand.Next(0, 255), rand.Next(0, 255), rand.Next(0, 255)))<br /><br />
<span style="color: #009900"> ' Calling the MarkerPanel Function<br /><br />
' And passing the mouse clicks location on the form</span><br />
<span style="color: #009900"> ' Create an instance of the new panel</span><br /><br />
<span style="color: #0000FF">Dim</span> p <span style="color: #0000FF">As</span> Panel = mm.MarkerPanel(<span style="color: #0000FF">CInt</span>(e.Location.X - (mm.MyWidth / 2)), <span style="color: #0000FF">CInt</span>(e.Location.Y - (mm.MyHeight / 2)))<br /><br />
<span style="color: #009900">' Name the new panel</span><br /><br />
p.Name = <span style="color: #CC0000">"key_" </span>& markerList.Count + 1<br /><br />
<span style="color: #009900">' This is adding the control to a collection for futur reference</span><br /><br />
markerList.Add(p.Name, mm)<br /><br />
<span style="color: #009900">' Add Event Handlers to handle the on click events</span><br /><br />
<span style="color: #0000FF">AddHandler</span> p.Click, <span style="color: #0000FF">AddressOf</span> Ellipse_Click<br /><br />
<span style="color: #009900">' Adding the newly create Panel Control to the form</span><br /><br />
<span style="color: #0000FF">Me</span>.Controls.Add(p)<br />
</div><br />
<span style="color: #0000FF"> End If</span><br />
</div><br />
<span style="color: #0000FF">End Sub</span><br />
Add the following Event to the form:
<br />
<span style="color: #0000FF">Private Sub</span> Ellipse_Click(<span style="color: #0000FF">ByVal</span> sender <span style="color: #0000FF">As Object</span>, <span style="color: #0000FF">ByVal</span> e <span style="color: #0000FF">As</span> System.EventArgs)<br /><br />
<div style="padding-left:10px; ">MsgBox(CType(sender, Panel).Name)</div><br />
<span style="color: #0000FF">End Sub</span><br />
Update the MapMarker Class with:
<br />
<span style="color: #0000FF">Dim</span> p <span style="color: #0000FF">As New</span> Panel<br /><br />
<span style="color: #0000FF">With</span> p<br /><br />
<div style="padding-left:10px; "><br />
.BackgroundImage = <span style="color: #0000FF">CType</span>(m_bmp, Image)<br /><br />
.Location = <span style="color: #0000FF">New</span> Point(xCoord, yCoord)<br /><br />
.Size = <span style="color: #0000FF">New</span> Size(m_width, m_height)<br /><br />
.Cursor = Cursors.Hand <br /><br />
<span style="color: #009900">''''''''''''''''''''''''''''''<br /><br />
'.AllowDrop = True<br /><br />
' Customize the panel as needed<br /><br />
''''''''''''''''''''''''''''''</span></div><br />
<span style="color: #0000FF">End With</span><br />
I'm listening but I only speak GEEK.
|
|
|
|
|
Hi,
I am using the following code to put all of the mp3 files in the Album directories into an array. This works fine, but what if there were more subdirectories, how can I change this code so that the the computer scans every single directory and subdirectory in f:\mp3 ?
Dim strFolder As String = "f:\mp3"
For Each strArtist As String In My.Computer.FileSystem.GetDirectories(strFolder)
For Each strAlbum As String In My.Computer.FileSystem.GetDirectories(strArtist)
For Each strFile As String In My.Computer.FileSystem.GetFiles(strAlbum)
If strFile.Substring(strFile.Length - 3) = "mp3" Then
objArraylist.Add(strFile)
End If
Next
Next
Next
Sorry if this is a silly question, but I've only been working with VB.Net for 3 months!
Thanks
|
|
|
|
|
I had to do something similiar (find every directory\file path for a server) and came up with the following code. You may be able to modify it for what you need:
Dim strpath As String = "f:\mp3" 'Your starting path
Dim BaseDir As New DirectoryInfo(strpath)
Dim DirListing() As DirectoryInfo
DirListing = BaseDir.GetDirectories()
Dim tmpFI As FileInfo
Dim tmpdir As DirectoryInfo
For Each tmpdir In DirListing
For Each tmpFI In BaseDir.GetFiles()
'Preforn your check and whatnot
Next
Next
David
|
|
|
|
|
Just set the FileIO.SearchOption , like so:
My.Computer.FileSystem.GetDirectories(strAlbum, FileIO.SearchOption.SearchAllSubDirectories)
|
|
|
|
|
Excellent work.
Thanks
So easy, with such a small piece of code.
I did also have to use the next line of code to build a list of the directories, if anyone else needs to use it.
Dim dir As ObjectModel.ReadOnlyCollection(Of String)
dir = My.Computer.FileSystem.GetDirectories("f:\mp3",FileIO.SearchOption.SearchAllSubDirectories)
|
|
|
|
|
Hello,
I can view report with crystal report viewer but I want remote users be able to view and print the report using Internet explorer. In order to do that, I need to export crytal report into html programmaticaly. So that when a user click on a button, the report can be viewed in html format.
How Can I do it using vb.net?
Thank you in advance.
programmer
|
|
|
|
|
I am currently attempting to develop a dll as a control in Visual Studio 5, VB.NET. The control has been created as a class, including a form and several functions.
Now, I want to be able to call that DLL from my VB main program. I am able to identify the DLL in a known directory and load the assembly. Now I want to instantiate the assembly and be able to use properties, such as with any other control in VB.NET (i.e., a Text Box...).
I have created a stub in a module that has the same class definition as that in the DLL, but when I attempt to associate the DLL class with the stub, I get
"Unable to cast object of type 'swControl.plugin' to type 'plugin'."
I have included my source code... Anybody have any ideas. I'm obviously doing something wrong!!
MY MAIN PROGRAM...
Public Class frmMainC
Private Glist As System.Collections.ObjectModel.ReadOnlyCollection(Of String)
Private Sub frmMainC_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'
Dim clsAssembly As System.Reflection.Assembly
Dim clsType As Type
Dim sTemp As String
'
Dim clsPlug As New plugin
'
Glist = My.Computer.FileSystem.FindInFiles(My.Application.Info.DirectoryPath & "\plugins", "dll", True, FileIO.SearchOption.SearchTopLevelOnly)
For Each name As String In Glist
Try
clsAssembly = System.Reflection.Assembly.LoadFrom(name)
For Each clsType In clsAssembly.GetTypes
If clsType.Name = "plugin" Then
clsPlug = clsAssembly.CreateInstance(clsType.FullName)
End If
Next
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End
End Try
'Dim var As New ucSwitch
'var.Top = Me.scMain_Console.Panel1.Top
'var.Left = Me.scMain_Console.Panel1.Left
'var.Width = Me.scMain_Console.Panel1.Width
'var.Visible = True
'var.BringToFront()
Next
End Sub
End Class
MY STUB:
Module Module1
Public Class plugin
Public Sub init()
End Sub
Public ReadOnly Property Fred()
Get
End Get
End Property
Public ReadOnly Property getsSWclass()
Get
End Get
End Property
Public ReadOnly Property PluginName()
Get
End Get
End Property
End Class
End Module
MY DLL CODE:
Public Class plugin
'Implements iPlugin
Private Sub ucSwitch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
init()
End Sub
Public Sub init()
Dim iLoop As Integer
Dim icolumns(16) As DataGridViewCheckBoxColumn
Dim Port(16) As DataGridViewCheckBoxColumn
Me.dgvSWpos.Rows.Clear()
Me.dgvSWpos.Columns.Clear()
For iLoop = 0 To 15
Port(iLoop) = New DataGridViewCheckBoxColumn
With Port(iLoop)
.HeaderText = iLoop + 1
.Name = "Ports"
End With
Me.dgvSWpos.Columns.Add(Port(iLoop))
Next
For iLoop = 0 To 3
Me.dgvSWpos.Rows.Add()
Me.dgvSWpos.Rows(iLoop).HeaderCell.Value = "Common " & Chr(iLoop + 65)
Next
Me.dgvSWpos.RowHeadersWidth = 100
End Sub
Public ReadOnly Property Fred() As String
Get
Return "Fred was here..."
End Get
End Property
Public ReadOnly Property getSWclass() As Integer
Get
Return 4
End Get
End Property
Public ReadOnly Property PluginName() As String
Get
Return "4x16 Switch"
End Get
End Property
End Class
|
|
|
|
|
Sir,
i want a code for date parsing in vb.net.Already i created a three combo boxes in design view to pick the date.backend is ms-access
Query i entered in program is
" dim date as string = combobox1.selectedvalue & "/" & combobox2.selectedvalue & "/" & combobox3.selectedvalue "
it shows error in that line .
is this right ? pls solve this query sir.
give the correct code for date declaration.
chandraprabha
pondicherry
mchandu
|
|
|
|
|
You can use the VB.NET function as follows:
Dim sDate = My.Computer.Clock.LocalTime.Date
That will format the date exactly as you are trying to get.
|
|
|
|
|
Standard question #2:
What error message do you get?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
im trying to open a exe with vb net but i got a problem, im using the process class and the exe aplication opens as a process but i cant see the aplication.... this is the code i use
Public p As New System.Diagnostics.Process
Public si As New System.Diagnostics.ProcessStartInfo
si.FileName = "calc.exe"
si.WorkingDirectory = "C:\"
si.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized
p.StartInfo = si
p.StartInfo.Arguments = ""
p.Start()
please help me
pd: sorry for my english...
Luis
|
|
|
|
|
The code looks right, but will NOT work in an ASP.NET page. VB.NET code runs server-side and will launch this calculator on the server, NOT the client side. The calculator will also NOT show on the servers desktop because it's being launched from a Service.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I used to be able to set DirectoryInfo to a path greater than 256 characters in VS2003 by using the GetShortPathName functuon but since I updated my code in VS2005 DirectoryInfo sees the path as the full length not the short path. It throws a PathTooLongException.
Does anyone know how I can get around this?
Example:
'ReallyLongPath is over 300 charactes long.
Dim ReallyLongPath as string = "D:\LongFolder\LogSubFolder\etc..."
Dim di As DirectoryInfo = New DirectoryInfo(GetShortPathName(ReallyLongPath))
|
|
|
|
|
That trick isn't going to work. One of the first things the constructor for the DirectoryInfo object does, in .NET 2.0, is convert the path you give it to a normalized form. That means converting it to it's Full Path specification. The limit on that returned (internally used) path is 260 characters.
No matter what, it's NEVER a good idea to use paths that long, for any reason. Not because of compatibility issues with the .NET Framework, but because of the same issues with other software, like BackupExec. Keep your paths under 260 characters if you want to avoid future problems.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|