CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Using Slider Control in client area

    Hi ,

    I want to use Slider Control in Client Area to set some parameters.

    How to do this ? I have used it in Dialog Box Only.

    Thanking you ..

    New_2012

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

    Re: Using Slider Control in client area

    Just set the size of the control equal the client size of the dialog.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: Using Slider Control in client area

    Thank you VictorN Sir ..

    I need to use Slider Control in my main program in client area.
    I have used it in dialog only using resource editor.

    Now I dont know whether I can use it in main program without dialog.
    I need to set temperature of furnace. I have implemented UP DOWN Arrow Keys
    But wish to give Edit Control or Slider Control .

    How to do this ?

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

    Re: Using Slider Control in client area

    What do you mean by "main program"?
    And what is the type of your application: dialog based, SDI, MDI, something else?
    Are you using MFC?
    Victor Nijegorodov

  5. #5
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: Using Slider Control in client area

    Thank you VictorN sir ..

    My application is MFC APP Wizard SDI application. It is not dialog based.
    I have divided screen in two parts .
    In one part I display Temp Controller Status.
    In other area I need to set Temp . I am doing that with Up Dn Arrow keys.
    But just I thought of having Slider Bar Control to set the temp.
    I have used it only in dialogs.

    so how to do it ?

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Using Slider Control in client area

    Quote Originally Posted by new_2012 View Post
    Now I dont know whether I can use it in main program without dialog.
    Any control is just a window. Any window can be made be a child of another window under condition you do it right. For example, a dialog can be embedded into another dialog or overlapped window. So answering your question: You can. And now you know it.

    Quote Originally Posted by new_2012 View Post
    How to do this ?
    CreateWindow or CreateWindowEx.

    P.S. The best way, imho, to avoid asking trivial questions on the forums is purchasing a decent reading on Programming Windows.
    Best regards,
    Igor

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

    Re: Using Slider Control in client area

    Quote Originally Posted by new_2012 View Post
    Thank you VictorN sir ..

    My application is MFC APP Wizard SDI application. It is not dialog based.
    In SDI you can use CFormView derived class. It is just (or almost) the same as a dialog:a dialog template where you can place the child controls
    Victor Nijegorodov

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

    Re: Using Slider Control in client area

    As Victor already said, if you have a form view (which is based on a dialog resource), you can easily put a slider as well as any other type of controls in its client area.
    Otherwise, put it in a dialog bar (also based on a dialog resource), which can be docked in the view's parent frame.
    Here is attached a demo project that uses slider controls for resizing thumbnail images and shadows in a view: http://codexpert.ro/blog/2015/07/03/...wing-with-mfc/
    It's an SDI application but it's easy to put dialog bars also in MDI clild frames, in the same way.
    .
    Last edited by ovidiucucu; January 24th, 2016 at 10:22 AM.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  9. #9
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: Using Slider Control in client area

    Thank you Igor vartanov sir , VictorN Sir and ovidiucucu sir.

    I will do it .. will go through the project and books.

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