My project is similar to JM's Manipulating GDI+ Drawings and NickThissen's Shape Editor. I haven't used their code though, I've written my own similar code. My shapes are custom controls.
All the shapes are working fine. But I'm having trouble with line control.
1. I've tried my own line control. But to resize/move I need to write separate code. The common code that works for all other shapes is not working.
2. I've tried VB Powerpack 3 Line Control,but moving/resizing it in runtime is too much complicated. It is NOT a real control. (I guess) It is directly drawn over a "ShapeContainer" control. So, i have to write custom code for this too.
I am trying to create TextBoxes and RichTextBoxes that can be moved and resized durig runtime as part of a program that makes/edits media-slides for online learning. The textboxes can currently be moved and resized by filling out the values for Top, Left, Height and Width on "property sheets", a method I would like to change into something a little bit more user-friendly
I created a user control with besides the TextBox or RichTextBox 3 objects to control the moving.I have currently added 3 panels to try to use for this purpose.I have written all the code to resize the TextBox when my new control is resized and when theMoveAndResizeHandles are set to be visible.The resize panels are currently 10 points x 10 points (easy to change because the 10 points are defined in a constant) and located top left above and bottom right under the textbox. The panel to resize is located next to top-left panel and has the width of the textbox - 10 pixels
My question at this point is: were Panels an appropriate choice or is there a more fitting way to do this? -and-
Which events should I use to check for movement and resizing of the control? I would start looking into "dragging and dropping" as event, but I have as yet no idea wether this will work and what the gotcha's will be in my approach.
I have to implement an application that allow the user to design his own card, the user will be able to drag and drop controls from toolbox and move them in the form and re-size them.
I can't make the control to be resizable,and i want to make the control just like the one in visual studio designer with the container that allow user to change the size ..
So I have my program make buttons similar to the above, I'm going to have a button created at the point were the cursor is, as long as the location is a valid one. Now I have two questions.
1) I want to use the following code to be able to move around any of the new buttons that I place down on the form.
' a quick TY to Ronald_Hare here on the forums for posting this little snippet, as it does exactly what I want. Private oControlOffsetPoint As Point Private Sub Button_MouseMove(ByVal sender As Object, ByVal e As
[Code].....
2) I also want to be able to change the back color of the button based on a number of boolean flags I will be setting. Is any of this possible without completely mangling things? I'm hoping there are some easy options for setting a button made on runtime to use a number of premade subs or functions.
On a side note: This does not need to be exclusively a button. a picturebox or a text box would probably work just as well for what I want to do, but I like the look I can get with the button atm.
I have a form on which I want to place labels created by code executed by clicking a button(cmdAddLabel) at run time. I subsequently want to move the newly created labels around on the form. The following code sucessfully creates the labels at run time whenever the cmdAddLabel button is clicked:
Private Sub cmdAddLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddLabel.Click Dim
I have a form that I want to have a control box so you can close it at any time but I don't want it to be movable from its origainal position. It opens maximized and I want it to stay maximized. I've tried all the different FromBorderStyle options in properties and I've tried all the SizeGripStyle properties though I can't say I've tried all the combinations possible between those two but whatever I've tried I can always click on the border at the top and then the form breaks free from its starting position and when it does the vertical scroll bar disappears.
How can I have this form stay in place with the vertical scroll bar and the control box and not break free from its starting position if someone clicks on the border at the top? If I try FromBorderStyle None then I don't have control box to close it. I was looking at the form events list and I noticed when I break the form free by clicking on the border that that is a ClientSizeChanged event.
I have created multiple dropdown list at runtime and populated with data. I also have added an eventhandler to determine the selected value of the drop down list.
The code is as follows : Dim tbl As New Table() tbl.EnableViewState = "true"
We need to start implementing verbose runtime output to assist with debugging on end users machines. If the executable is launched with a particular parameter, we need this to kick in. This is not necessarily "error" logging, but runtime logging to see exactly which lines of code have been executed. We literally have to add an output line after each line of code in every function. Without question, this is extremely tedious.
I was hoping there might be a better way at doing this, such as possibly using reflection at runtime to somehow output which line of code in which module just completed.
I have this code which creates a picturebox during runtime and displays line graph but I always get an error in this line: gr1.DrawImage(pic1.Image, -m_Dx, 0) 'it says Value cannot be null. Parameter name: image
code Public Class Form1 Private Const m_Dx As Single = 1 Dim data As Integer = 1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim pic1 As New PictureBox
I just made a basic browser using VB... So now I am wondering how to make it resizable so that when it is resized the browser and buttons remain in same layout but the text box and browser space resize to the new screen size and the buttons do not change layout or get covered (it has buttons for back, forward, refresh, home, and stop then a text box for the url and then a go button, I want them to remain in same order but the text box to enlarge and the go button to keep to the right side of the box - and I want the browser spot to grow too).
I am running a program that needs to allow the user to be able to change the size of a text box at run time. I know I need to use the MouseDown, mouseMove, and mouseUp events. I just need some help with the coding to send the information.
I do want my windows to be resizable i.e. the MDI Child ws should not be resizable. owever, I could not find any property which I can set for the same.
I have made form with no border,removed default title bar And placed a picture box,have set the image too, So,now I want to make it moveable, i tried each moveable title bar code,but it gives many error, What would be the code to make that title bar picture box movable??
Okay, what I want to do is snap a movable panel to the form, like create a virtual grid kind of thing. The panels can be moved with the mouse and stop moving once the left mouse key is released.For the movable panel I have used a Class, it creates an object called NewComp in the toolbox.
Public Class NewComp Inherits Panel Public Sub New()
In VB6 there was a property on the form called movable that if set to false meant that the form could only be moved through code ... just wondering how i can do something like this in .net ... i don't want anything that flickers either like: vb Private Sub Form1_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LocationChanged Me.Location = New Point(100, 100) End Sub the above flickers occasionally when the form is moved
Recently I was working on a project that included several DataGridView objects. With one, I dynamically create columns based on the types of data being displayed. I established a baseline size (so each column would initially display the same width), and a minimum size. AutoSizeMode was set to None. I knew that I wanted the new column to be resizable by the user, so I put in code to that effect: Resizable = True
When I tested the code, the columns were not resizable. I traced the code, looking for anything that would reset the property Resizable to False. Nothing. I commented out the line with the Resizable = True command; The columns were resizable after this. At this point, I remembered that Resizable is defaulted to true. But I still did not understand why the columns were not resizable after setting the property to True.
I did some experiments. If you create a new DatagridViewTextBoxColumn, add it to the DatagridView, and then set the Resizable property to True, the result (via Watch) is False {2}. If you do the same, but set the Resizable property to False, the result is True {1}.
This is disturbing (and confusing) on at least two levels. The fact that the exact opposite boolean value is passed in. The fact that {2} is False. It was always my understanding that VB treated {0} as False, and Any other value as True.
I have two DataGridView controls, with three buttons in between them vertically, in a VB 2005 form that need to be resized and moved around on a form resize.
The code below works, and does what I want. It takes the difference between the new size and the default size, splits the height difference between the two DataGridViews, and moves things around correctly.
What bugs me about it is that I've hard-coded the defaults into the ResizeEnd handler. How would I go about passing the default size so that I don't repeat myself?
Even better, is there a way to do it with anchoring, docking, and other stuff, so that I don't even need to write code?
Private Sub dlgShowAssets_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd Dim defaultWindowSize As New System.Drawing.Size(759, 619)
i want to make a form with movable command buttons.the aim is that these buttons will represent the computers that are installed in one room.or the tables in one bar.all the tables can change depending the order that user give.
i create StudentForm as my mdi child form, what i suppose to do to let user unable to move my mdi child form to other location? i want it to be static location
Private Sub StudentToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StudentToolStripMenuItem.Click StudentForm.Show() StudentForm.MdiParent = Me End Sub
I'm recently tried to make a custom tabcontrol that able to move the tab to left or right...
But there's a problem, I'm don't know how to get the tab's item width... What I get with TabControl1.SelectedTab.Bounds.Width is the tabpage's width, not tab item's width...
I need to get tab item's width to know if the selected tab had to be stay, or move left, or move right, when the mouse is moving and holding...
For an example, if the cursor pressed and holding Tabpage1, and it move to Tabpage2, then the Tabpage1 should be move right...
If I can get the tab item's width, then I can know the cursor is on which tab by mathematics... Or if can, I want to get the tab that on the cursor directly...
I need to have a custom background on a panel that can be resized with the form and want to know how I should go about designing it. Maybe have three images the left side, right side and the middle is just replicated? The thing is I would like for it to have a border and there will be buttons attached to the top edge so simply stretching a static picture may make the buttons not line up properly.
How can i best make a movable widget within a windows form application? I wanted a area inside the form where the widgets can be placed / moved, i was thinking something like Windows desktop gadgets, where you can move them around and add/remove them. i was thinking of using a group box to contain each individual widget (notepad, time, calc ect) and a flow layout panel to contain and move all of the widgets.
Also i was hoping there would be a way to actually have icons to press which place the widgets into the flow layout panel.
I am making a CSS layout creator. You can create reziable/dragable sqares. And when you press a button it get the css code for it. How would i get the locations and size of each box? And then spit that all out in a rich text box?
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