473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Moveable Toolbars

VJ
I am looking to implement moveable toolbars like in Word, or Visual
Studio... any pointers or articles would great..

Thanks
VJ
Nov 20 '05 #1
3 1127
Hi VJ,

I made this sample for John Crouse, however the only thing in my opinion
what you have to change basicly are toolbars instead of labels.

(You can open a windowform application, delete all the code, past this
bellow in and try)

I hope this helps.

Cor

\\\
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub New()
MyBase.New()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Private WithEvents Label1 As New System.Windows.Forms.Label
Private WithEvents Label2 As New System.Windows.Forms.Label
Private mouseX, mouseY As Integer
Private arLabels() As Label
Dim myMousedown As String
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.ClientSize = New System.Drawing.Size(400, 400)
Label1.Name = "Label1"
Label2.Name = "Label2"
arLabels = New Label() {Label1, Label2}
Dim lblY As Integer = 100
For Each Lbl As Label In arLabels
Lbl.Location = New System.Drawing.Point(100, lblY)
Lbl.ForeColor = Color.Red
Lbl.BackColor = Color.Transparent
Lbl.TextAlign = ContentAlignment.MiddleCenter
Lbl.Text = Lbl.Location.X.ToString & "." &
Lbl.Location.Y.ToString
AddHandler Lbl.MouseDown, AddressOf Label_MouseDown
AddHandler Lbl.MouseUp, AddressOf Label_MouseUp
AddHandler Lbl.MouseMove, AddressOf Label_MouseMove
lblY += 30
Me.Controls.Add(Lbl)
Next
End Sub
Private Sub Label_MouseDown(ByVal sender As Object, ByVal _
e As System.Windows.Forms.MouseEventArgs)
Dim lbl As Label = DirectCast(sender, Label)
myMousedown = lbl.Name
lbl.BringToFront()
mouseX = Cursor.Position.X - lbl.Location.X
mouseY = Cursor.Position.Y - lbl.Location.Y
lbl.Cursor = Cursors.Hand
End Sub
Private Sub Label_MouseUp(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs)
Dim lbl As Label = DirectCast(sender, Label)
myMousedown = ""
lbl.Cursor = Cursors.Default
End Sub
Private Sub Label_MouseMove(ByVal sender As Object, ByVal e _
As System.Windows.Forms.MouseEventArgs)
Dim lbl As Label = DirectCast(sender, Label)
Static LastCursor As Point
Dim NowCursor As Point = New Point(Cursor.Position.X,
Cursor.Position.Y)
If Point.op_Inequality(NowCursor, LastCursor) Then
If myMousedown = lbl.Name Then
lbl.Location = New System.Drawing.Point(Cursor.Position.X _
- mouseX, Cursor.Position.Y - mouseY)
End If
LastCursor = Cursor.Position
lbl.Text = lbl.Location.X.ToString & "." &
lbl.Location.Y.ToString
End If
End Sub
End Class
///
Nov 20 '05 #2
* "VJ" <vi********@yahoo.com> scripsit:
I am looking to implement moveable toolbars like in Word, or Visual
Studio... any pointers or articles would great..


Do you want to implement that on your own or are you looking for
(commercial) components?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3
Hi, Check out this website:

http://www.divil.co.uk

I use his components and they are amazing! So long as the application you
are writing is freeware, the license is free.

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"VJ" <vi********@yahoo.com> wrote in message
news:OJ*************@TK2MSFTNGP11.phx.gbl...
I am looking to implement moveable toolbars like in Word, or Visual
Studio... any pointers or articles would great..

Thanks
VJ

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Dorsey | last post by:
Hello I'm creating a web page that contains a flash presentation. I currently have it resizing the user's web page and placing it on the screen using this script: ...
1
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to...
4
by: MLH | last post by:
Is there a simple way to hide built-in toolbars in A97?
2
by: Galaxia | last post by:
Hi, I'm using C# in VS .Net 2003. How can I build movable toolbars as that in VS IDE, dragging and arranging them? More, how can the moveable toolbar be put into the same line of Menu, as that in...
1
by: simon | last post by:
Is it posible to create moveable panel in asp.net? When user clicks on time link in my dataGrid, I open the panel over the datagrid. If the panel is opened, than data below the panel is not...
3
by: Flashster | last post by:
How do I create a moveable toolbar that can be docked on a windows form?. I'm using vb .net (2002). I have added the toolbar item to the windows form, but I cannot see a way of making it...
15
by: Neil | last post by:
So, I tried to copy a toolbar. I have a custom menu bar for a form. Tried to copy it so that I could modify the copy and use it with another form. With no direct way to copy it, I made a copy of...
6
by: ll | last post by:
Hi, I'm currently working with a 'classic ASP' intranet site which uses a SQL server and am looking for possible ways to market it as an application for certain medical fields. Where would be a...
4
by: olseni | last post by:
Hi, i am trying to make a report which consists of many subreports, and I need to make the subreports moveable and not show when the subreport has no data. I use an event procedure in the 'On no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.