Compartir a través de


CTaskDialog::SetOptions

Configurar las opciones para CTaskDialog.

void SetOptions(
   int nOptionFlag
);

Parámetros

  • [in] nOptionFlag
    El conjunto de indicadores para CTaskDialog.

Comentarios

Este método limpia todas las opciones actuales para CTaskDialog. Para guardar las opciones actuales, debe recuperarlas primero con CTaskDialog::GetOptions y combinarlos con las opciones que desea establecer.

La tabla siguiente muestra todas las opciones válidas.

  • TDF_ENABLE_HYPERLINKS
    Hipervínculos de permisos en CTaskDialog.

  • TDF_USE_HICON_MAIN
    configura CTaskDialog utilizar HICON para el icono principal. la alternativa es utilizar LPCWSTR.

  • TDF_USE_HICON_FOOTER
    Configura CTaskDialog utilizar HICON para el icono de pie de página. la alternativa es utilizar LPCWSTR.

  • TDF_ALLOW_DIALOG_CANCELLATION
    Permite al usuario para cerrar CTaskDialog mediante el teclado o utilizando el icono de la esquina superior derecha del cuadro de diálogo, incluso si el botón de Cancelar no está habilitada. Si este marcador no se establece y el botón de Cancelar no está habilitado, el usuario no puede cerrar el cuadro de diálogo mediante Alt+F4, la tecla ESC, o el botón cerrar titlebar.

  • TDF_USE_COMMAND_LINKS
    Configura CTaskDialog utilizar controles de Botón de comando.

  • TDF_USE_COMMAND_LINKS_NO_ICON
    Configura CTaskDialog utilizar controles de Botón de comando sin mostrar un icono junto al control. TDF_USE_COMMAND_LINKS reemplaza TDF_USE_COMMAND_LINKS_NO_ICON.

  • TDF_EXPAND_FOOTER_AREA
    Indica que se expande el área de extensión actualmente.

  • TDF_EXPANDED_BY_DEFAULT
    Determina si se expande el área de la extensión de forma predeterminada.

  • TDF_VERIFICATION_FLAG_CHECKED
    indica que la casilla de la comprobación es actualmente seleccionado.

  • TDF_SHOW_PROGRESS_BAR
    Configura CTaskDialog para mostrar una barra de progreso.

  • TDF_SHOW_MARQUEE_PROGRESS_BAR
    Configura la barra de progreso para ser una barra de progreso de la marquesina. Si se habilita esta opción, debe establecer TDF_SHOW_PROGRESS_BAR para obtener el comportamiento esperado.

  • TDF_CALLBACK_TIMER
    Indica que el intervalo de devolución de CTaskDialog está establecido en aproximadamente 200 milisegundos.

  • TDF_POSITION_RELATIVE_TO_WINDOW
    Configura CTaskDialog para estar centrado en relación con la ventana primaria. Si este marcador no está habilitado, CTaskDialog se centra en relación con monitor.

  • TDF_RTL_LAYOUT
    Configura CTaskDialog para un diseño de derecha a izquierda que lee.

  • TDF_NO_DEFAULT_RADIO_BUTTON
    Indica que no hay ningún botón de radio cuando aparece CTaskDialog .

  • TDF_CAN_BE_MINIMIZED
    Permite al usuario para minimizar CTaskDialog. para admitir esta opción, CTaskDialog no puede ser modal. MFC no admite esta opción porque MFC no admite CTaskDialogno modal.

Ejemplo

// TODO: Replace the strings below with the appropriate message,  
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title, 
    TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON );

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
    L"Click here for more information.",
    L"Click here to hide the extra information.");

// Change the options to show the expanded information by default. 
// It is necessary to retrieve the current options first. 
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

Requisitos

encabezado: afxtaskdialog.h

Vea también

Referencia

CTaskDialog Class

Gráfico de jerarquías

CTaskDialog::GetOptions