Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Selection change in dialog box..

Selection change in dialog box..

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shah Satish
    wrote on last edited by
    #1

    Hi !!! First of all i am sorry for deleting my question..Here still i have problem..look In my Application,I created one dialog box..In this dialog box,I cretaed small 2 boxes.One is for list of Symbol ( text ) and second box is for preview of the drawing. For exam:- Box1: Box 2 ( preview ) Exchanger-Double end Exchanger-Single end Exchanger-Double end kettle My requirement is, If I will click on Exchanger-Double end ( box1) from dialog box then it will show me drawing of Exchanger-Double end ..If I will click on Exchanger-Single end then it will show me preview of Drawing Exchanger-Single end. My code is:-

    BOOL CDwgPvDLG::OnInitDialog()
    {
    CDialog::OnInitDialog();

    //CDwgPreview    
    
    m\_mytext.AddString(\_T("Exchanger-Double end"));
      m\_mytext.AddString(\_T("Exchanger-Single end"));
      m\_mytext.AddString(\_T("Exchanger-Double end kettle"));
     
    
      m\_mytext.SetCurSel(0);
    
      mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_1\_i.dwg");
    
    
    
    
    
    return TRUE;
    

    }

    void CDwgPvDLG::OnPaint()
    {

    // this is class for Preview of the drawing.
    
    
    CDwgPreview ::ShowInDialog (mydwg,this,IDC\_PVTYP);
    
    CPaintDC dc(this); // device context for painting
    // TODO: Add your message handler code here
    // Do not call CDialog::OnPaint() for painting messages
    

    }

    void CDwgPvDLG::OnselectionchangeList()
    {
    // TODO: Add your control notification handler code here

    int nEntry = m_mytext.GetCurSel();

    switch (nEntry)

    {

    case 0:
    mydwg = _T("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg");
    break ;

    case 1:

     mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_2\_i.dwg");
     break ; 
    

    case 2:

     mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_3\_i.dwg");
    
     break;
    

    }

    }

    Anybody know How can I do it ?? Thanking you.. Shah

    D P 2 Replies Last reply
    0
    • S Shah Satish

      Hi !!! First of all i am sorry for deleting my question..Here still i have problem..look In my Application,I created one dialog box..In this dialog box,I cretaed small 2 boxes.One is for list of Symbol ( text ) and second box is for preview of the drawing. For exam:- Box1: Box 2 ( preview ) Exchanger-Double end Exchanger-Single end Exchanger-Double end kettle My requirement is, If I will click on Exchanger-Double end ( box1) from dialog box then it will show me drawing of Exchanger-Double end ..If I will click on Exchanger-Single end then it will show me preview of Drawing Exchanger-Single end. My code is:-

      BOOL CDwgPvDLG::OnInitDialog()
      {
      CDialog::OnInitDialog();

      //CDwgPreview    
      
      m\_mytext.AddString(\_T("Exchanger-Double end"));
        m\_mytext.AddString(\_T("Exchanger-Single end"));
        m\_mytext.AddString(\_T("Exchanger-Double end kettle"));
       
      
        m\_mytext.SetCurSel(0);
      
        mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_1\_i.dwg");
      
      
      
      
      
      return TRUE;
      

      }

      void CDwgPvDLG::OnPaint()
      {

      // this is class for Preview of the drawing.
      
      
      CDwgPreview ::ShowInDialog (mydwg,this,IDC\_PVTYP);
      
      CPaintDC dc(this); // device context for painting
      // TODO: Add your message handler code here
      // Do not call CDialog::OnPaint() for painting messages
      

      }

      void CDwgPvDLG::OnselectionchangeList()
      {
      // TODO: Add your control notification handler code here

      int nEntry = m_mytext.GetCurSel();

      switch (nEntry)

      {

      case 0:
      mydwg = _T("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg");
      break ;

      case 1:

       mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_2\_i.dwg");
       break ; 
      

      case 2:

       mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_3\_i.dwg");
      
       break;
      

      }

      }

      Anybody know How can I do it ?? Thanking you.. Shah

      D Offline
      D Offline
      Don Box
      wrote on last edited by
      #2

      See, u handle the selection event of the list, and upon notifying, draw the things in the other box. Where the problem is?

      Come online at:- jubinc@skype

      1 Reply Last reply
      0
      • S Shah Satish

        Hi !!! First of all i am sorry for deleting my question..Here still i have problem..look In my Application,I created one dialog box..In this dialog box,I cretaed small 2 boxes.One is for list of Symbol ( text ) and second box is for preview of the drawing. For exam:- Box1: Box 2 ( preview ) Exchanger-Double end Exchanger-Single end Exchanger-Double end kettle My requirement is, If I will click on Exchanger-Double end ( box1) from dialog box then it will show me drawing of Exchanger-Double end ..If I will click on Exchanger-Single end then it will show me preview of Drawing Exchanger-Single end. My code is:-

        BOOL CDwgPvDLG::OnInitDialog()
        {
        CDialog::OnInitDialog();

        //CDwgPreview    
        
        m\_mytext.AddString(\_T("Exchanger-Double end"));
          m\_mytext.AddString(\_T("Exchanger-Single end"));
          m\_mytext.AddString(\_T("Exchanger-Double end kettle"));
         
        
          m\_mytext.SetCurSel(0);
        
          mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_1\_i.dwg");
        
        
        
        
        
        return TRUE;
        

        }

        void CDwgPvDLG::OnPaint()
        {

        // this is class for Preview of the drawing.
        
        
        CDwgPreview ::ShowInDialog (mydwg,this,IDC\_PVTYP);
        
        CPaintDC dc(this); // device context for painting
        // TODO: Add your message handler code here
        // Do not call CDialog::OnPaint() for painting messages
        

        }

        void CDwgPvDLG::OnselectionchangeList()
        {
        // TODO: Add your control notification handler code here

        int nEntry = m_mytext.GetCurSel();

        switch (nEntry)

        {

        case 0:
        mydwg = _T("C:\\Symbol\\Exchangers\\Exchanger_1_i.dwg");
        break ;

        case 1:

         mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_2\_i.dwg");
         break ; 
        

        case 2:

         mydwg = \_T("C:\\\\Symbol\\\\Exchangers\\\\Exchanger\_3\_i.dwg");
        
         break;
        

        }

        }

        Anybody know How can I do it ?? Thanking you.. Shah

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        Shah Satish wrote:

        // this is class for Preview of the drawing. CDwgPreview ::ShowInDialog (mydwg,this,IDC_PVTYP);

        What does this function do ? Have considered the fact that, you need to invalidate the rectangle , before drawing to it ? Can you be clear about your problem ?

        Prasad Notifier using ATL | Operator new[],delete[][^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups