I wonder if this way is right or wrong!!

in my project, it provides a single web page, then many forms WebContainer in which are housed within a WebDialog (modal), and second of the action triggered the recall WebDialog concerned.

I wonder if this way is right or wrong

if Item.Caption = "File" then
    
    if Choice.Tag = "New Circle" and app.IOActivity = "admin" then
      dim cc as new WebDialog_request_circle
      cc.Left = (self.Width-cc.Width)/2
      cc.Top = (self.Height-cc.Height)/2
      cc.Title = Choice.Text
      cc.Show
    end if
    
    if Choice.Tag = "New News" and app.IOActivity = "admin" then
      dim cc as new WebDialog_new_news
      cc.Left = (self.Width-cc.Width)/2
      cc.Top = (self.Height-cc.Height)/2
      cc.Show
    end if
    
    if Choice.Tag = "My Circle" then
      dim cc as new WebDialog_request_circle_update
      cc.Left = (self.Width-cc.Width)/2
      cc.Top = (self.Height-cc.Height)/2
      cc.Title = Choice.Text
      cc.Show
    end if
    
    if Choice.Tag = "New member" then
      dim cc as new WebDialog_associati
      cc.Left = (self.Width-cc.Width)/2
      cc.Top = (self.Height-cc.Height)/2
      cc.Title = "Associati circolo "+ app.IOFullName
      cc.Show
    end if
    
    if Choice.Text = "Setting" and app.IOActivity = "admin" then
      dim cc as new WebDialog_setting_menu
      cc.Left = (self.Width-cc.Width)/2
      cc.Top = (self.Height-cc.Height)/2
      cc.Show
    end if
    
  elseif Item.Caption= "Service" or Item.Caption= "Structure" or Item.Caption= "Operator" then
    
    dim cc as new WebDialog_schedule_new
    cc.Left = (self.Width-cc.Width)/2
    cc.Top = (self.Height-cc.Height)/2
    cc.Title = Choice.Text
    cc.ContainerControl_schedule_new1.Category = Choice.Text
    cc.Show
    
  elseif Item.Caption= "Language" then
    
    if Choice.Text = "Setting" and app.IOActivity = "admin" then
      dim cc as new WebDialog_setting_menu
      cc.Left = (self.Width-cc.Width)/2
      cc.Top = (self.Height-cc.Height)/2
      cc.Show
    elseif Choice.Text = "IT" then
      P_Menu_it
    elseif Choice.Text = "EN" then
      P_Menu_en
    else
      MsgBox("feature only for admin.")
    end if
    
  else
    MsgBox("You are not entitled..."+ Choice.Text)
  end if

There is no real right or wrong in programming. There is simple and elegant which works, versus confuse and awkward that does not work.

Your WebContainer approach is a valid one.

[quote=208419:@Michel Bujardet]There is no real right or wrong in programming. There is simple and elegant which works, versus confuse and awkward that does not work.

Your WebContainer approach is a valid one.[/quote]

Thank :slight_smile:

what I wonder if with the simple and close, modal dialog is destroyed or not!!