Search found 19 matches
- Sunday 5th May 2024 1:17pm
- Forum: Beginners
- Topic: How do I write multiple statements on a single line?
- Replies: 1
- Views: 112
How do I write multiple statements on a single line?
In BASH, I can chain multiple commands using ; Is this possible? I was trying to do something similar to: startX = 127; lastX = 0; stepX = -1 startY = 1; lastY = 127; stepY = 1 But I've been forced to do: startX = 127 lastX = 0 stepX = -1 startY = 1 lastY = 127 stepY = 1 Since I have to do this 9 ti...
- Sunday 5th May 2024 1:11pm
- Forum: Beginners
- Topic: Get X,Y coordinates from inside the DrawingArea
- Replies: 4
- Views: 188
Re: Get X,Y coordinates from inside the DrawingArea
Thanks for the extra pointers, Bruce.
Really getting to know GAMBAS now - !
Really getting to know GAMBAS now - !
- Tuesday 30th April 2024 8:36am
- Forum: Beginners
- Topic: Get X,Y coordinates from inside the DrawingArea
- Replies: 4
- Views: 188
Re: Get X,Y coordinates from inside the DrawingArea
Nevermind. I figured it out.
No need to use DrawingArea object. Just need to get Mouse.X, Mouse.Y
No need to use DrawingArea object. Just need to get Mouse.X, Mouse.Y
Public Sub DrawingArea1_MouseDown()
Print Mouse.X & "," & Mouse.Y
End
- Tuesday 30th April 2024 7:36am
- Forum: Beginners
- Topic: Get X,Y coordinates from inside the DrawingArea
- Replies: 4
- Views: 188
Get X,Y coordinates from inside the DrawingArea
I've got dots in a DrawingArea and I'm looking to click on any of these dots and get the x,y coordinates. I tried using the `DrawingArea_MouseDown` event: Public Sub DrawingArea1_MouseDown() Dim da As DrawingArea = FMain.Controls["DrawingArea1"] Print da.Cursor.X & "," & ...
- Wednesday 24th April 2024 2:52am
- Forum: Beginners
- Topic: Draw randomly colored dots in DrawingArea - how?
- Replies: 9
- Views: 738
Re: Draw randomly colored dots in DrawingArea - how?
@brucesteers If I wanted to clear the DrawingArea, what's the process? Some reading [1] led me to believe that the .Clear method would be the answer but it doesn't do what I expected: Public Sub btnClear_Click() clearform = True DrawingArea1.Clear DrawingArea1.Refresh End I even tried setting the .C...
- Monday 22nd April 2024 4:03am
- Forum: Beginners
- Topic: Draw randomly colored dots in DrawingArea - how?
- Replies: 9
- Views: 738
Re: Draw randomly colored dots in DrawingArea - how?
Haha. I think your main problem was thinking the Draw() event and refresh do little bits. But no , the refresh triggers the Draw event for a complete draw. Exactly! I initially only had the redraw in the inner loop but thought maybe I needed more - ;). Thanks for your help. Really appreciated. Chee...
- Sunday 21st April 2024 10:48pm
- Forum: Beginners
- Topic: Draw randomly colored dots in DrawingArea - how?
- Replies: 9
- Views: 738
Re: Draw randomly colored dots in DrawingArea - how?
Ouch! That was like a wake up slap - duh - !BruceSteers wrote: ↑Sunday 21st April 2024 9:49pm ...
or make your dots an array that the Draw event paints the same array each time.
- Sunday 21st April 2024 9:14pm
- Forum: Beginners
- Topic: Draw randomly colored dots in DrawingArea - how?
- Replies: 9
- Views: 738
Re: Draw randomly colored dots in DrawingArea - how?
Hey Bruce, I've modified my code as you had it above and noticed that the DrawingArea refresh several times when loses or gains focus and on form resize. Is this something that can be overcome? As it currently stands, it's not ideal for what I'm planning to do with it. The PictureBox is already gain...
- Sunday 21st April 2024 9:04pm
- Forum: Beginners
- Topic: Draw randomly colored dots in DrawingArea - how?
- Replies: 9
- Views: 738
Re: Draw randomly colored dots in DrawingArea - how?
Depending on the application it can be better to use a simple PictureBox and use paint functions to paint the picture. Like I say it depends on the application, sometimes a DrawingArea is prefered , sometimes a Picture A PictureBox can be easily manipulated and things added to it, PictureBox1.Pictu...
- Sunday 21st April 2024 1:24pm
- Forum: Beginners
- Topic: Draw randomly colored dots in DrawingArea - how?
- Replies: 9
- Views: 738
Draw randomly colored dots in DrawingArea - how?
I've got this simple program that I'm trying to create randomly colored dots in the drawing area but all I get is the first dot (when program loads) and the last dot (after clicking the button). How do I make is to that I get to see randomly colored dots across the entire DrawingArea? To make the do...