CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    8

    Edit Scroll bar Processing Messages

    Hello,

    First I appreciate your replies to my first post, they were very helpful. I am having an issues now with an edit control that is a child of the parent window.

    hSGroups = CreateWindowEx(0, TEXT("EDIT"), NULL, WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | WS_BORDER | ES_LEFT, rc.left+200+120, 20, 500, 250, hWnd, (HMENU)SGroups_Identifyer , hInst, NULL);

    When I click in the edit field of the control I get a message in my WndProc in the command field. When I click on the edit controls vertical scroll bar....... I get no messages. I have read that the edit control processes its own messages for scrolling. I have also read that a messages is supposed to happen though the command field after I click the vert scroll button.

    I also notice that when ES_MULTILINE is specified, pressing the scroll bar (once active / entered text has gone past edit window limit), the message generated is the correct message and it is sent to the WndProc and can be caught by the command field.

    I want a one line edit window with vert scroll message that can be caught by my main window / WndProc without the ES_MULTILINE specified. Any help is appreciated.

  2. #2
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Edit Scroll bar Processing Messages

    If its one line edit box where from the vertical scroll comes into view ?

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Edit Scroll bar Processing Messages

    Edit control without ES_MULTILINE style does NOT (and cannot) have a vertical scrollbar.
    Victor Nijegorodov

  4. #4
    Join Date
    Jan 2011
    Posts
    8

    Re: Edit Scroll bar Processing Messages

    Well, I was hoping to do a numerical increment/decrement with the scroll attached to the single line edit. I guess I will just put some custom buttons to do the job. Thanks, I appreciate all of the input.

  5. #5
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Edit Scroll bar Processing Messages

    Quote Originally Posted by JPatchSPSU View Post
    Well, I was hoping to do a numerical increment/decrement with the scroll attached to the single line edit. I guess I will just put some custom buttons to do the job.
    Use a spin button (up-down) control and set the edit control as its buddy. Then, you can handle WM_VSCROLL message sent to parent window.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  6. #6
    Join Date
    Jan 2011
    Posts
    8

    Re: Edit Scroll bar Processing Messages

    "Use a spin button (up-down) control and set the edit control as its buddy. Then, you can handle WM_VSCROLL message sent to parent window".


    Hmm did some research.. is the spin button part of the MFC library? If so thanks anyway, because that would cause me to rewrite all my code to use that -> to use the encapsulation library.

    if not, I was wondering if I could get one or two good references on some code that uses only the win32 API and shows how the buddy thing works. (please excuse me if my jargon is a little off)

    Thanks in advance

Tags for this Thread

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

Featured