Search found 17 matches

by ak2766
Tuesday 30th April 2024 8:36am
Forum: Beginners
Topic: Get X,Y coordinates from inside the DrawingArea
Replies: 3
Views: 87

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

Public Sub DrawingArea1_MouseDown()

  Print Mouse.X & "," & Mouse.Y
 
End
by ak2766
Tuesday 30th April 2024 7:36am
Forum: Beginners
Topic: Get X,Y coordinates from inside the DrawingArea
Replies: 3
Views: 87

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 & "," & ...
by ak2766
Wednesday 24th April 2024 2:52am
Forum: Beginners
Topic: Draw randomly colored dots in DrawingArea - how?
Replies: 9
Views: 382

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...
by ak2766
Monday 22nd April 2024 4:03am
Forum: Beginners
Topic: Draw randomly colored dots in DrawingArea - how?
Replies: 9
Views: 382

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...
by ak2766
Sunday 21st April 2024 10:48pm
Forum: Beginners
Topic: Draw randomly colored dots in DrawingArea - how?
Replies: 9
Views: 382

Re: Draw randomly colored dots in DrawingArea - how?

BruceSteers wrote: Sunday 21st April 2024 9:49pm ...
or make your dots an array that the Draw event paints the same array each time.
Ouch! That was like a wake up slap - duh - :mrgreen: !
by ak2766
Sunday 21st April 2024 9:14pm
Forum: Beginners
Topic: Draw randomly colored dots in DrawingArea - how?
Replies: 9
Views: 382

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...
by ak2766
Sunday 21st April 2024 9:04pm
Forum: Beginners
Topic: Draw randomly colored dots in DrawingArea - how?
Replies: 9
Views: 382

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...
by ak2766
Sunday 21st April 2024 1:24pm
Forum: Beginners
Topic: Draw randomly colored dots in DrawingArea - how?
Replies: 9
Views: 382

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...
by ak2766
Tuesday 16th April 2024 5:49am
Forum: Lounge
Topic: ChatGPT: something to play with over Christmas
Replies: 11
Views: 24300

Re: ChatGPT: something to play with over Christmas

cogier wrote: Friday 3rd March 2023 3:14pm I now have access to the Bing AI. Here is my first question and the answer. The code works without modification!
I bet we are all wondering what the question was...
by ak2766
Tuesday 16th April 2024 5:48am
Forum: Lounge
Topic: ChatGPT: something to play with over Christmas
Replies: 11
Views: 24300

Re: ChatGPT: something to play with over Christmas

stevedee wrote: Friday 23rd December 2022 7:23pm I assume that if anyone asks the exact question that I asked at the start of this chat, they should get a code example with these problems corrected if the AI bot is really learning from experience.
Interestingly, ChatGPT doesn't learn from past interactions with others:
Selection_02616.png
Selection_02616.png (77.51 KiB) Viewed 3661 times