如何激活对话框标题栏工具提示? [英] How to activate a dialog title bar tooltip?

查看:125
本文介绍了如何激活对话框标题栏工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

这是我最近遇到的麻烦.我的应用程序(VS 2008,VC ++)基于从文件读取的信息打开一个子对话框.完整的文件路径应该显示在对话框标题栏中...好吧-这很简单,并且会显示路径. 不幸的是,有时路径太长而无法容纳并被截断.我的客户之前(当我使用VC ++ 6.0时)抱怨说,有一个工具提示,当鼠标悬停在标题栏上时出现,他们可以看到工具中的完整路径 提示(即使我没有在代码中对此做出任何明确规定).现在情况有所不同-有点混乱:
当我运行程序时,根本没有显示工具提示-但是,当我尝试远程尝试(从家连接到我的工作站)时,工具提示窗口在那里,即使有些失真:显示了标题的一部分,而结束部分是 只是黑色.
我并不特别担心远程访问(只是好奇)-但是如何为对话框强制使用标题栏工具提示?

Here is the nuisance I faced recently. My application (VS 2008, VC++) opens a child dialog based on the information read from a file. The full file path is supposed to be displayed in the dialog title bar... Well - this is trivial, and the path is displayed. Unfortunately sometimes the path is too long to fit and gets truncated. My customers complain thet before (when I was using VC++ 6.0) there was a tooltip, which appeared upon the mouse hovering over the title bar, and they could see the full path in the tool tip (even though I did not make any explicit provisions for that in the code). Now the situation is different - and a bit confusing:
when I run the program no tool tip is displayed at all - but when I tried to try it remotely (connecting to my workstation from home), the tool tip window was there, even though somewhat distorted: part of the title was displayed, while the ending part was just black.
I am not particularly concerned about the remote access (just curious) - but how to enforce the title bar tooltip for a dialog?

先谢谢您

Mike

推荐答案

工具提示是一个黄色的小方框,当用户将鼠标置于控件顶部时,该单词会显示一个单词或一组单词:

A tool tip is a small yellow box that displays a word or a group of words when the user positions the mouse on top of a control:

创建工具提示

To create a tool tip system in a Visual Studio application, first add a ToolTip control to a form. After adding a ToolTip control, the form and all controls on it receive a new field in the Properties window. If the new ToolTip control is called ToolTip1, the new field in the Properties window for each control is ToolTip on ToolTip1. To display a tool tip for a control, first click it on the form. Then, in the Properties window, click ToolTip on ToolTip1, and type the desired tool tip.

实践学习:添加工具提示

Practical Learning: Adding Tool Tips

  1.   <身体>
    控制 工具提示上的工具提示
    dtpOrderDate 点击箭头以选择日期
    dtpOrderTime 单击每个部分,然后单击箭头之一以更改其值
    cboFlavors 点击箭头以显示列表,然后从列表中选择一种口味
    cboContainers 单击以显示容器列表,然后选择一个容器
    cboIngedients 显示成分列表,让客户选择
    txtScoops 输入铲子的数量(1、2或3)以填充容器
    txtOrderTotal 这会显示该订单的总金额
    btnCalcTotal 点击此处计算订单总额
    btnNewOrder 点击此处重置表格
    btnClose 点击此处关闭表格
  1. To prepare for tool tips, on the Toolbox, click ToolTip and click the form
  2. On the form, click each control and, in the Properties window, set its ToolTip On ToolTip1 property as follows:
     
    Control ToolTip On ToolTip1
    dtpOrderDate Click the arrow to select a date
    dtpOrderTime Click each section, then click one of the arrows to change its value
    cboFlavors Click the arrow to display a list, then select a flavor from the list
    cboContainers Click to display the list of containers and select one
    cboIngedients Display the list of ingredients and make the customer's choice
    txtScoops Enter the number of scoops (1, 2, or 3) to fill the container
    txtOrderTotal This displays the total amount of this order
    btnCalcTotal Click here to calculate the total of the order
    btnNewOrder Click here to reset the form
    btnClose Click here to Close the form
  3. Test the application
  1. 将其关闭并返回到Visual Studio
  1. Close it and return to Visual Studio

SREE


这篇关于如何激活对话框标题栏工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆