Results 1 to 12 of 12

Thread: Line Numbers in Notepad Clone?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91

    Question

    hi, i want to make a notepad clone, but want to have the line numbers running down the side of it, and i really dont know how to do it..any ideas?

    and also how do i get it to scroll if i use a textbox or rich-txt-box and a label down the side? pls help me!

    Thanks,

    Mag-Net

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    labels surely don't solve your problem, write directly on the form, using print. To move the position to print use currentx and currenty. What do you mean with the scrolling? You can have a scrollbar scroll the text and then update the form in the event. use autoredraw to make the screenclearing nice. (cls)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    Now i dont know how to make the line numbers scroll when u scroll the text box, there is no event or property???

    if i used my own scroll bars, how do i get the text to scroll in the text box? there is no event is there?

    thanks

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I c your problem now, you must subclass in both cases for the scrolling and get an event(I don't know how) but it sure can be done
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91

    Unhappy

    well err, does anyone now know how I am going to be able to do this? As I don't have a clue! thanks anyway....
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    you could put the line number sin a list box

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    hmm, yeah but doing this, i still have the problem of getting the listbox to scroll along with the text box wouldnt I, how do I get around that?

    Thanks for the help
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I'm not the person to tell you since i haven't subclassed that much but looked up (there was no WM_SCROLL) but there was WM_MBUTTONDOWN = &H207. You can probably get that one.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91
    ok thanks, i dont know about subclassing...STOP laughing at me! I will read about it now, and then try it. thanks a lot!
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Lol, i'm not laughing, seriously, i've made some subclassing, i made a control that does it but I'm not sure, Sam said it wouldn't be that easy, but it works for me
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  11. #11
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    Look up AddressOf and SetWindowLong. Using these, you can intercept the Windows messages that are generated. SBM_GETPOS may be a helpful constant. Because you're interfering with Windows messages, it's a lot easier to crash your program, so you should save before each run.
    Wade

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Location
    Lowestoft
    Posts
    91

    Thumbs up

    thanks for that, i will try it out
    Mag-Net's Home
    Visual Studio 6-Enterprise - SP4
    ICQ: 35519773
    Have Fun

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width