Allow User To Resize Drawn Rectangle By Dragging Border?

Feb 24, 2009

I want to write a vb program to allow user to draw rectangle. User can click on a point as starting position and drag on the screen. A rectangle is drawn with the current mouse position and the starting position. The user then release the mouse as end position. When the rectangle is drawn, user can resize the rectangle by drag the border of the rectangle.

View 2 Replies


ADVERTISEMENT

Divide The Content In My Application To Groups Each Group Has Its Own Rectangle Border With The Group Name Located At The Top Border

Jul 22, 2009

I want to divide the content in my application to groups each group has its own rectangle border with the group name located at the top border, i've seen it before and i'm not sure what is the correct name of this control, anyone knows what I'm talking about ? EDIT: Ok, I found the Groupbox Control but how do i use it? should i just drag other controls inside it or i should add controls directly into it?

View 2 Replies

Restore The Background Behind A Drawn Rectangle?

Apr 14, 2012

In my application I need to draw several filled rectangles on a panel with a tiled background image. Depending on user actions, certain - not all - rectangles must be removed afterwards, revealing the background image again. Drawing and filling the rectangles is not so difficult, but how can I remove them in such a way that the background gets restored correctly?

View 2 Replies

VS 2008 Clear A Rectangle Drawn?

Aug 25, 2009

So; I've drawn this rectangle vb Dim zr As New Rectangle(100, 100, 100, 100)e.Graphics.DrawRectangle(Pens.Red, zr)

View 4 Replies

Drawing A Resizable Rectangle (by Edge/corner Dragging)?

Jul 19, 2003

I am trying to make a rectangle that can be resized by the userby clicking and dragging the edges/corners of the rectangleTypically, if the mouse enters the rectangle region, then smalladjustment boxes should appear at the corners of the rectangleand also at the middle of the rectangle's edges (to allow the userto drag and resize the rectangle). When the mouse leaves therectangle region, then the adjustment boxes should disappear.I have the code to draw the rectangle and to produce the smalladjustment boxes, but I'm not sure how to accomplish thedrag and resizing steps (or if it's even possible with the way mycode is written).

Code:Imports SystemImports System.DrawingImports System.Windows.Forms
Private bBlocking, bValidBox As Boolean Private pt1, pt3 As Point Private rectBox As Rectangle Private cornerRect1 As Rectangle Private cornerRect2 As

[code]....

View 10 Replies

VS 2008 Owner Drawn Combobox The Border?

Jan 26, 2011

Ok so i have an owner drawn combobox and everything is fine in the drawitem event,except i'm a perfectionist and there is no border i have a beige backcolor, and i really just want a black border or something first i tried to draw using the given graphics and the given bounds, it failed as the rectangle was drawn oddly inside the combobox for some reason (not on the inner border, almost in the center of the combobox.then i tried the following and was surprised when it didnt work

Dim z2fx As Graphics = Graphics.FromHwnd(cmbBox.Handle)
z2fx.DrawRectangle(Pens.Black, New Rectangle(0, 0, cmbBox.Width, cmbBox.Height))

then i tried this and thought for sure it would work

1 Dim zfx As Graphics = Graphics.FromHwnd(cmbBox.Parent.Handle)
zfx.DrawRectangle(Pens.Black, cmbBox.Bounds)

this drew 2 sides of the border, the bottom and the right then i realized something: the code i used earlier with z2fx made the upper and left borders flicker right when i click the drop down, then it goes away. It is as if they were being redrawn with the background color of the combobox. And this redrawing was taking place after the drawitem event was called.

Something, some event, keeps redrawing the background color of the combobox when i put a button on the form and associate it with the zfx2 code, then when i press this button the combobox draws the 2 borders (upper and left) and they stay drawn until i either hover over the combobox or open the drop down of the combobox.

nvm while typing this i figured out a solution i can use the mouseenter mouseleave and dropdown events

since i typed this already im posting it anyway if i have problems i will let you know.EDIT: failed.SOMETHING keeps redrawing the damn background only after most events have passed! i tried the backgroundcolorchanged event it didnt work. this is annoying.

View 1 Replies

Rectangle Drawn On Picturebox Gets Erased When Scroll Image?

Apr 1, 2010

rectangle drawn on picturebox gets erased when i scroll image.i.e

i have made application for image cropping. on mouse down and mouse up event, an rectangle is drawn on picturebox using graphics.

1) now the problem is that when scroll image rectangle drawn on picturebox gets erased.

2)now i want resize this rectangle as per user's interest

how to resize the rectangle and drag the rectangle on picture box.

View 5 Replies

Old Graphics Still Drawn On Form Resize

May 21, 2010

I'm creating a custom form that is composed of a inner stroke, outer stroke, and rounded rectangular background. When the form is initially drawn its drawn fine without errors but once i re size it, the old form is still drawn and the new form is drawn below it but once i minimize the form and restore it, it goes back to normal (only the new form is being drawn).

View 2 Replies

Resize Border Less Form

Oct 7, 2010

I am able to resize the from using the code below but it resizes towards right side , from bottom right corner i want to modify the code so that user can re size the form from bottom left corner. also most of the solution given on this site are based on WndProc / WM_NCLBUTTONDOWN and i am not using it because my form have lots of controls so it flicker's very badly.

[Code]...

View 1 Replies

Create A Flat Tabcontrol With A Rounded Rectangle Tab For The Selected Tab + No Border For Inactive Tabs?

Feb 14, 2011

i'm trying to create a flat tabcontrol with a rounded rectangle tab for the selected tab + no border for inactive tabs?basically i'm trying to recreate that ribbon control in a very simplified form as a usercontrol.

View 5 Replies

Draw And Resize By Selecting A Rectangle?

Dec 8, 2009

how to draw and resize by selecting a rectangle in winformsby using power pack tools or graphics.drawrectangle() method

View 1 Replies

Resize Image [jpg, Png] Through Rectangle API With Mouse Move?

Jan 21, 2011

I using vb6.0.I want to load a image into a picture box and resize it in runtime through mouse.Image type is jpg or png.my logic is,

1. load image[jpg or png ] into picture box and draw a rectangle using rectangle API, according to image size.

2. resize rectangle through mouse and according to the size of rectangle change size of image.

View 3 Replies

ListView - Finding The User Dragging Left Or Right End?

Aug 2, 2010

When the user drags to left, I have to add the item to previous row. When the user drags to right, I have to add the item to nect row.

The below code is not working as expected. each row has 5 items. When the user drags to right in the first row, It is giving the TargetIndex as 5. It is giving the same value for targetindex, when the user drags the item in 2nd row to left end.

Private
Sub PictureList_DragDrop(ByVal
sender As System.Object,

[Code]....

View 1 Replies

VS 2008 Disable User From Dragging A Form?

Jun 28, 2010

Is there a way to disable a user from dragging a form other than setting the form border style to "None" ?

View 8 Replies

User Muse Click On Drawn Line?

Oct 8, 2011

I have drawn (3) lines on a panel, each a diff color. I want user to muse click on a given line to bring up a label that will explane what the line is telling the user. There s/b no bit maps involved. I am using graphics to draw the panels and lines.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

[code]....

My code above will draw the line but i can not see how to use path to get a "hit" on mouse move for the line?I use private routines to draw many panels and assign pens to colors and panels. I must be able to connect panel and line ID to pen name to know the nature of the line to label it! I can see that path must be used; but how?

View 2 Replies

VS 2008 Creating A User-drawn Listbox Class?

Aug 1, 2009

having trouble trying to add different items to the listbox. What happens is that the item that's in the listbox gets redrawn every time I try to add new item, why is that?

vb.net
Public Class ColoredListBox
Inherits System.Windows.Forms.ListBox

[code]....

View 10 Replies

Change The Background Color Of A Node That Is Being Hovered Over While The User Is Dragging Items From A List Box?

Jul 26, 2009

I'm trying to change the background color of a node that is being hovered over while the user is dragging items from a list box.I've gotten both functions to work separately, but while the user is dragging, the NodeMouseHover event does not fire. Is there a way to do both?

vb Private Sub trvNavigation_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles trvNavigation.DragEnter
If Me.CanMove(e) Then
e.Effect = DragDropEffects.Copy

[Code]...

Note: CanMove() is a function I made that verifies the dragged data. Nothing else. And I will change "Color.Blue" to a system color later.

View 2 Replies

Detect Mouse In User Control - Border Color Change?

Dec 28, 2010

I've got a couple of instances of a user control on a flowlayoutpanel. The user control has got a couple of controls on it, and very little / almost none of the control's original space is visible. I need to know when the mouse is inside the usercontrol. What then happens is that the border color changes (of a control in the user control), and when it leaves the control, it changes back to original state.

I tried the following:
Private Sub ctrDashboardWidgetFrame_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MouseEnter
Try
ShowControls()
Catch ex As Exception
[Code] .....

And it works, but it only works when you move over the original visible space of the user control, and doesn't work when you move over the child controls inside the user control. How I'll be able to achieve this to also work while the user is inside the full user control and not just it's visible space?

dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf'
dp.SyntaxHighlighter.HighlightAll('c7f9624a181a409ebf7e3e1f57df5ce8')
[URL]

View 7 Replies

Random "notch" In User-drawn Control

Jan 26, 2012

I have my control here, and when the control isn't drawing selected, it has a random notch in the border(as illustrated in the attached photo). It uses a graphics path which is generally used all around so nothing changes there. Other than the fact the control is marked "selected"(which only effects the colors). Here's the code that generates my graphics path...

[Code]...

View 9 Replies

Make A Program That Will Calculate The Area Of A Rectangle Based On The Length And Width Given By The User

Nov 20, 2009

im trying to make a a rogram that will calculate the area of a rectangle based on the lenght and

width given by the user

[code...]

View 4 Replies

List(of Rectangle), Rectangle.offset(x,y) Doesn't Work?

Jul 26, 2010

i've got a little problem with List(on T) variables.

[code]...

It works perfectly fine. Does anyone know what the problem is?

View 2 Replies

Border And Border Color Of Textbox And Label

Aug 4, 2009

I am using vb express 2008.How I can have border around a Textbox or Label and change the color of border. Like we have different border styles and colours in MsWord and other applictions. Also how a Lable can be made transparent?

View 4 Replies

Creating Forms With Border Like Calendar Border?

Nov 15, 2010

How we can create a form with border like calendar border. I changed ControlBox to False and Text to vbnullstring. but only when FormBorderStyle is Sizable or SizableToolWindow form border apears. This form is sizable. Is there any way to create forms with this border but not sizable? I want to create form like this:[URL]

View 6 Replies

Allow User To Select And Resize Image

Jan 17, 2009

I've got code to allow the user to import an image to the document they have opened, however right now, the image displays at it's default size, and well, if it's a large image, the document stretches and looks like crap. I want the user to be able to select the image after they insert it, and have the handles show up on the corners so they can resize it, and would also like to have it allow them to move it around the document if possible. [Code]

View 2 Replies

Allowing User To Resize Trackbar?

Jul 15, 2009

i would like to allow the user to play around with the size of the trackbar in vb.net. is there an easy way to do this?

View 1 Replies

ListView Resize With User Drag?

Dec 8, 2009

I am converting my company's VB6 program over to VB.net and I have hit another stupid little roadblock.

The old program had a ListView docked to the left side of the application screen. The user could place the cursor over the right portion of the ListView, the cursor would turn into the SizeWE arrows, then they could drag it, which would resize the ListView.

I am trying to recreate this. As far as I can tell there is no Property called "Resizable," or at least nothing is popping out to me. I do not believe that it is being done in the code.

Is there a property I am missing? If not, is there an easy way to do this within the code? (ie. is there a event that would make my life easier)

I am using Visual Studio 2008.

Edit: I see how how it was done in the previous program (you always seem to find it once you ask the question, don't you?). The old program had a invisible picture that was only a few pixels wide that when hovered over would change the cursor to SizeWE. You could then drag that invisible picture and that would hit an event that would then change the size of the ListView. This seems rather convoluted. My question still stands: Is there a better way to handle this dragging and resizing?

View 2 Replies

Identify Subtriangle Within A Rectangle Given A Coordinate In That Rectangle?

Feb 22, 2010

Given a rectangle of width w and height h. and a coordinate x,y in that rectangle I would like to identify which triangle I am within.

i.e. the function should take parameters(x,y) and return a,b,c,d or a zero based number representing that triangle index i.e. (0=A,1=B,2=C,3=D) if they are in that order.

I think this would be something like >= the formula of the red line and >= the formula of the green line?

I'd like to implement this in VB.NET

View 3 Replies

Disallow User To Resize Form In Runtime?

Jan 15, 2009

I have a windows form. I dont want the user to be allowed to maximize or resize the form.

View 5 Replies

Lock The Size Of A Form So The User Can't Resize It?

Jan 25, 2009

How do you lock the size of a form so the user can't resize it?

View 3 Replies

Resize A Form On Load To Fit To The User's Screen

Apr 7, 2009

I'm trying to figure out how to resize a form on load to fit to the user's screen. Many of my users are on laptops, or split screens between laptop and monitor..I remember in VB6, it was something like form.height = screen.height (or something of the sort)... but I can't find this functionality in VB.NET 2008. I'm also trying to wrap everything (multiple screens/forms) into one app, so I wanted to know if anyone was aware of any tutorials on form parent/child relationships... I don't want to keep opening and hiding forms individually without having them packaged in one work area....

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved