-
Sep 4th, 2016, 09:36 AM
#1
Simulating a Code Window With Richtextbox
I'm basically writing a 6502 emulator to run the code that you type. I subclassed two richtextboxes. One to show line numbers and one for the actual code window. I did this in order to sync the scrollbar with the code window so when you scroll through the code, the line numbers scroll with it at the same time! So far this works great. However if the text reaches the bottom of the visible part of the richtextbox and you press enter, the line number doesn't scroll with it. This is one problem Im still trying to tackle.
Another problem is similar to above. If you grabbing a large chunk of code to copy and paste, I want the line numbers to scroll with it in the other richtextbox!
Another problem is that I'm trying to zoom in and out using both ctrl+mousewheel which will cause both the richtextboxes to zoom in at the same time. I have some code to get control over the mousewheel in the WndProc message handler but I dunno how to fully control mouse up or down to change the zoomfactor. Google wasnt much of a help as most results involved the mousewheel event. But I prefer through this WndProc message handler in my subclassed Richtextbox. I know that once I have this working, I can check if the Control.Modifierkeys == Keys.Control is pressed as the mousewheel is being checked to have that Visual Studio like zoom for the code window. But like I said, I have no idea how to check if the mousewheel is scrolling up or down with the message handler. I DO NOT want to use the mousewheel event.
I would show what I currently have but at the moment In not home. I'm at work and literally typing this off my phone. Any help is appreciated. Thanks
[EDIT] I'll provide my sample code when I get home from work tonight. I know. It's a tough thing to pull off yet it somewhat works so far
Last edited by Jacob Roman; Sep 4th, 2016 at 02:21 PM.
-
Sep 4th, 2016, 03:25 PM
#2
Re: Simulating a Code Window With Richtextbox
I am soooo saving this site. Think I found part of a possible solution http://www.mapwindow.org/phorum/read.php?3,8852,8856
-
Sep 9th, 2016, 10:34 PM
#3
New Member
Re: Simulating a Code Window With Richtextbox
Thanks for the good tips, I really appreciate your efforts.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|