滚动条-可滚动文字的窗口

MATLAB绘制动态滚动条 笔者主要介绍如何用MATLAB绘制动态滚动条 阅读详情

      就像玩War3时对不死族的恐惧一样,做界面时一直都不想去涉及滚动条,借端午节狠下心来把滚动条又看了一遍,再一次印证实践才是真理,把对滚动条的理解写下来,以便于以后查阅。

 

滚动条结构

上图是MSDN中对滚动条的描述,很直观,而滚动条相关的消息也不多最常用的也就是WM_VSCROLL和WM_HSCROLL,这两个消息的LOWORD (wParam)参数对应了一系列Request Code:

Request

Action

Response

SB_LINEUP

The user clicks the top scroll arrow.

Decrements the scroll box position; scrolls toward the top of the data by one unit.

SB_LINEDOWN

The user clicks the bottom scroll arrow.

Increments the scroll box position; scrolls toward the bottom of the data by one unit.

SB_LINELEFT

The user clicks the left scroll arrow.

Decrements the scroll box position; scrolls toward the left end of the data by one unit.

SB_LINERIGHT

The user clicks the right scroll arrow.

Increments the scroll box position; scrolls toward the right end of the data by one unit.

SB_PAGEUP

The user clicks the scroll bar shaft above the scroll box.

Decrements the scroll box position by the number of data units in the window; scrolls toward the top of the data by the same number of units.

SB_PAGEDOWN

The user clicks the scroll bar shaft below the scroll box.

Increments the scroll box position by the number of data units in the window; scrolls toward the bottom of the data by the same number of units.

SB_PAGELEFT

The user clicks the scroll bar shaft to the left of the scroll box.

Decrements the scroll box position by the number of data units in the window; scrolls toward the left end of the data by the same number of units.

SB_PAGERIGHT

The user clicks the scroll bar shaft to the right of the scroll box.

Increments the scroll box position by the number of data units in the window; scrolls toward the right end of the data by the same number of units.

SB_THUMBPOSITION

The user releases the scroll box after dragging it.

Sets the scroll box to the position specified in the message; scrolls the data by the same number of units the scroll box has moved.

SB_THUMBTRACK

The user drags the scroll box.

Sets the scroll box to the position specified in the message and scrolls the data by the same number of units the scroll box has moved for applications that draw data quickly. Applications that cannot draw data quickly must wait for the SB_THUMBPOSITION request code before moving the scroll box and scrolling the data.

SB_ENDSCROLL

The user releases the mouse after holding it on an arrow or in the scroll bar shaft.

No response is needed.

1设置滚动条参数

一般都是在WM_SIZE消息中设置滚动条的信息,这样当窗口大小变化时滚动条可以做相应的改变,以显示或者隐藏之或者改变其ScrollBox的大小。

MSDN上面有一段说道滚动条的显示问题:

Scroll Bar Visibility

The system hides and disables a standard scroll bar when equal minimum and maximum values are specified. The system also hides and disables a standard scroll bar if you specify a page size that includes the entire scroll range of the scroll bar. This is the way to temporarily hide a scroll bar when it is not needed for the content of the client area. There is no need to make scrolling requests through the scroll bar when it is hidden. The system enables the scroll bar and shows it again when you set the minimum and maximum values to unequal values or when the page size that does not include the entire scroll range. The ShowScrollBar function can also be used to hide or show a scroll bar. It does not affect the scroll bar's range, page size, or scroll box position.

The EnableScrollBar function can be used to disable one or both arrows of a scroll bar. An application displays disabled arrows in gray and does not respond to user input.

红色标记的地方说道,系统会在两种情况下隐藏并禁用滚动条,1是在SCROLLINFO中的nMin==nMax时,由于最小滚动位置和最大滚动位置相等当然没有必要显示滚动条了,2是在指定的nPage,也就是当前窗口客户区可以显示的单位数据的大小,包含整个滚动范围,这时当前客户区可以显示所有的数据,因此不需要滚动条。MSDN上面是这样描述page size的:

page size代表滚动条的Ower窗口的当前客户区大小可以容纳单位数据的大小,例如如果客户区可以容纳16行文字,那么应该将page size设置为16,系统使用page size,以及滚动范围以及滚动条长度,来设置scroll box的大小,当一个包含滚动条的窗口改变大小时,应该通过SetScrollInfo设置page size。

2滚动窗口

进行窗口滚动的操作是在WM_VSCROLL或者WM_HSCROLL中完成的,先根据相应的Request Code对nPos进行调整,然后调用SetScrollInfo对nPos这一项进行调整,之后通过ScrollWindowEx滚动窗口,根据MSDN上面的例子可以看出,先保存先前的nPos,然后用调整后的nPos与之想减,再乘上水平或者垂直方向的单位尺寸,即为滚动的区域。

3滚动后可见的窗口区域的绘制

当窗口滚动后,面对的首要问题就是如何显示之前不可见现在可见的区域,对于滚动文字,需要处理当然是需要WM_PAINT了。这里看得不是很懂,但是通过TRACE可以发现的是WM_PAINT确实是在Invalide区域中重绘,当单击垂直滚动条的三角按钮时系统只重绘一行文字,具体方法可以看下面的源码。

下面的源码是MSDN的例子:

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

{

      int wmId, wmEvent;

      //////////////////////////////////////////////////////////////////////////

      HDC hdc;

      PAINTSTRUCT ps;

      TEXTMETRIC tm;

      SCROLLINFO si;

 

      // These variables are required to display text.

      static int xClient;     // width of client area

      static int yClient;     // height of client area

      static int xClientMax;  // maximum width of client area

 

      static int xChar;       // horizontal scrolling unit

      static int yChar;       // vertical scrolling unit

      static int xUpper;      // average width of uppercase letters

 

      static int xPos;        // current horizontal scrolling position

      static int yPos;        // current vertical scrolling position

 

      int i;                  // loop counter

      int x, y;               // horizontal and vertical coordinates

 

      int FirstLine;          // first line in the invalidated area

      int LastLine;           // last line in the invalidated area

      HRESULT hr;

      size_t  abcLength=0;       // length of an abc[] item

      // Create an array of lines to display.

      #define LINES 28

      static TCHAR *abc[] = {

           TEXT("anteater"),  TEXT("bear"),      TEXT("cougar"),

           TEXT("dingo"),     TEXT("elephant"),  TEXT("falcon"),

           TEXT("gazelle"),   TEXT("hyena"),     TEXT("iguana"),

           TEXT("jackal"),    TEXT("kangaroo"),  TEXT("llama"),

           TEXT("moose"),     TEXT("newt"),      TEXT("octopus"),

           TEXT("penguin"),   TEXT("quail"),     TEXT("rat"),

           TEXT("squid"),     TEXT("tortoise"),  TEXT("urus"),

           TEXT("vole"),      TEXT("walrus"),    TEXT("xylophone"),

           TEXT("yak"),       TEXT("zebra"),

           TEXT("This line contains words, but no character. Go figure."),

           TEXT("")

      };

 

      //////////////////////////////////////////////////////////////////////////

      switch (message)

      {

      case WM_CREATE:

           {

                 CreateWindowEx(

                      0L,                          // no extended styles

                      _T("SCROLLBAR"),                 // scroll bar control class

                      (LPCWSTR) NULL,                // text for window title bar

                      WS_CHILD | SBS_HORZ,         // scroll bar styles

                      0,                           // horizontal position

                      0,                           // vertical position

                      200,                         // width of the scroll bar

                      50,               // default height

                      hWnd,                   // handle to main window

                      (HMENU) NULL,           // no menu for a scroll bar

                      hInst,                  // instance owning this window

                      (LPVOID) NULL           // pointer not needed

                      );

      //////////////////////////////////////////////////////////////////////////

                 // Get the handle to the client area's device context.

                 hdc = GetDC (hWnd);

                 // Extract font dimensions from the text metrics.

                 GetTextMetrics (hdc, &tm);

                 xChar = tm.tmAveCharWidth;

                 xUpper = (tm.tmPitchAndFamily & 1 ? 3 : 2) * xChar/2;

                 yChar = tm.tmHeight + tm.tmExternalLeading;

                 // Free the device context.

                 ReleaseDC (hWnd, hdc);

                 // Set an arbitrary maximum width for client area.

                 // (xClientMax is the sum of the widths of 48 average

                 // lowercase letters and 12 uppercase letters.)

                 xClientMax = 48 * xChar + 12 * xUpper;

                 return 0;

                 //////////////////////////////////////////////////////////////////////////

           }

      case WM_COMMAND:

           wmId    = LOWORD(wParam);

           wmEvent = HIWORD(wParam);

           // 分析菜单选择:

           switch (wmId)

           {

           case IDM_ABOUT:

                 DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);

                 break;

           case IDM_EXIT:

                 DestroyWindow(hWnd);

                 break;

           default:

                 return DefWindowProc(hWnd, message, wParam, lParam);

           }

           break;

      case WM_SIZE:

           {

                 // Retrieve the dimensions of the client area.

                 yClient = HIWORD (lParam);

                 xClient = LOWORD (lParam);

 

                 // Set the vertical scrolling range and page size

                 si.cbSize = sizeof(si);

                 si.fMask  = SIF_RANGE | SIF_PAGE;

                 si.nMin   = 0;

                 si.nMax   = LINES - 1;

                 si.nPage  = yClient / yChar;

                 SetScrollInfo(hWnd, SB_VERT, &si, TRUE);

 

                 // Set the horizontal scrolling range and page size.

                 si.cbSize = sizeof(si);

                 si.fMask  = SIF_RANGE | SIF_PAGE;

                 si.nMin   = 0;

                 si.nMax   = 2 + xClientMax / xChar;

                 si.nPage  = xClient / xChar;

                 SetScrollInfo(hWnd, SB_HORZ, &si, TRUE);

                 return 0;

           }

      case WM_HSCROLL:

           {

                 // Get all the vertial scroll bar information

                 si.cbSize = sizeof (si);

                 si.fMask  = SIF_ALL;

                 // Save the position for comparison later on

                 GetScrollInfo (hWnd, SB_HORZ, &si);

                 xPos = si.nPos;

                 switch (LOWORD (wParam))

                 {

                      // user clicked left arrow

                 case SB_LINELEFT:

                      si.nPos -= 1;

                      break;

                      // user clicked right arrow

                 case SB_LINERIGHT:

                      si.nPos += 1;

                      break;

                      // user clicked the scroll bar shaft left of the scroll box

                 case SB_PAGELEFT:

                      si.nPos -= si.nPage;

                      break;

                      // user clicked the scroll bar shaft right of the scroll box

                 case SB_PAGERIGHT:

                      si.nPos += si.nPage;

                      break;

                      // user dragged the scroll box

                 case SB_THUMBTRACK:

                      si.nPos = si.nTrackPos;

                      break;

                 default :

                      break;

                 }

                 // Set the position and then retrieve it.  Due to adjustments

                 //   by Windows it may not be the same as the value set.

                 si.fMask = SIF_POS;

                 SetScrollInfo (hWnd, SB_HORZ, &si, TRUE);

                 GetScrollInfo (hWnd, SB_HORZ, &si);

 

                 // If the position has changed, scroll the window

                 if (si.nPos != xPos)

                 {

                      ScrollWindowEx(hWnd, xChar * (xPos - si.nPos), 0, NULL, NULL,

                             NULL, NULL,SW_INVALIDATE|SW_ERASE);

                      //ScrollWindow(hWnd, xChar * (xPos - si.nPos), 0, NULL, NULL);

                 }

                 return 0;

           }

      case WM_VSCROLL:

           {

                 // Get all the vertial scroll bar information

                 si.cbSize = sizeof (si);

                 si.fMask  = SIF_ALL;

                 GetScrollInfo (hWnd, SB_VERT, &si);

                 // Save the position for comparison later on

                 yPos = si.nPos;

                 switch (LOWORD (wParam))

                 {

                      // user clicked the HOME keyboard key

                 case SB_TOP:

                      si.nPos = si.nMin;

                      break;

 

                      // user clicked the END keyboard key

                 case SB_BOTTOM:

                      si.nPos = si.nMax;

                      break;

 

                      // user clicked the top arrow

                 case SB_LINEUP:

                      si.nPos -= 1;

                      break;

 

                      // user clicked the bottom arrow

                 case SB_LINEDOWN:

                      si.nPos += 1;

                      break;

 

                      // user clicked the scroll bar shaft above the scroll box

                 case SB_PAGEUP:

                      si.nPos -= si.nPage;

                      break;

 

                      // user clicked the scroll bar shaft below the scroll box

                 case SB_PAGEDOWN:

                      si.nPos += si.nPage;

                      break;

 

                      // user dragged the scroll box

                 case SB_THUMBTRACK:

                      si.nPos = si.nTrackPos;

                      break;

 

                 default:

                      break;

                 }

                 // Set the position and then retrieve it.  Due to adjustments

                 //   by Windows it may not be the same as the value set.

                 si.fMask = SIF_POS;

                 SetScrollInfo (hWnd, SB_VERT, &si, TRUE);

                 GetScrollInfo (hWnd, SB_VERT, &si);

                 // If the position has changed, scroll window and update it

                 if (si.nPos != yPos)

                 {                   

                      ScrollWindow(hWnd, 0, yChar * (yPos - si.nPos), NULL, NULL);

                      UpdateWindow (hWnd);

                 }

                 return 0;

           }

      case WM_PAINT:

           {

                 // Prepare the window for painting

                 hdc = BeginPaint (hWnd, &ps);

                 // Get vertical scroll bar position

                 si.cbSize = sizeof (si);

                 si.fMask  = SIF_POS;

                 GetScrollInfo (hWnd, SB_VERT, &si);

                 yPos = si.nPos;

                 // Get horizontal scroll bar position

                 GetScrollInfo (hWnd, SB_HORZ, &si);

                 xPos = si.nPos;

                 // Find painting limits

                 FirstLine = max (0, yPos + ps.rcPaint.top / yChar);

                 LastLine = min (LINES - 1, yPos + ps.rcPaint.bottom / yChar);

                 sprintf(szDebug,("%d,%d,%d,%d/r/n"),ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right,ps.rcPaint.bottom);

                 OutputDebugStringA(szDebug);

                 ZeroMemory(szDebug,0);

      sprintf(szDebug,"FirstLine=%d,LastLine=%d/r/n",FirstLine,LastLine);

                 OutputDebugStringA(szDebug);

                 for (i = FirstLine; i <= LastLine; i++)

                 {

                      x = xChar * (1 - xPos);

                      y = yChar * (i - yPos);

                      // Note that "55" in the following depends on the

                      // maximum size of an abc[] item.

                      //

                      hr = StringCchLength(abc[i], 100, &abcLength);

                      if ((FAILED(hr)) | (&abcLength == NULL))

                      {

                            /*MessageBox(hWnd,_T("字符串长度为!"),_T("错误"),MB_ICONERROR);*/

                      }

                      else

                      {

                            TextOut(hdc,x,y,abc[i],abcLength);

                      }

                 }

                 // Indicate that painting is finished

                 EndPaint (hWnd, &ps);

                 return 0;

           }

      case WM_DESTROY:

           PostQuitMessage(0);

           break;

      default:

           return DefWindowProc(hWnd, message, wParam, lParam);

      }

      return 0;

}

windows程序设计笔记:显示文字 绘制和更新在Windows中,只能在窗口的显示区域绘制文字和图形,Windows是一个消息驱动系统。它通过把消息投入应用程序消息队列中或者把消息发送给合适的窗口消息处理程序,将发生的各种事件通知给应用程序。Windows通过发送WM_PAINT消息通知窗口消息处理程序,窗口的部分显示区域需要绘制。1.WM_PAINT消息2.1以下情况窗口消息处理程序会接收到一个WM_PAINT消息:1.移动窗口或显示窗口时,窗口中先前被隐藏的区域重新可见。2.改变窗口的大小(如果窗口类别样式有着CS_HREDRAW和CS_ 阅读详情

相关推荐

滚动页面标题文字动态变化js特效

这是一款滚动页面标题文字动态变化js特效。该特效在页面向下或向上滚动时,当进入指定的视口区域,标题文字会产生炫酷的动画效果。

[War3]Fdf文件详解,简单的UI教程演示 - 魔兽争霸3

[UI]背景模板 Frame "BACKDROP" "Powerbak"{ Width 0.055, //宽度 Height 0.055, //高度 BackdropTileBackground, //背景平铺 BackdropBackground "UI\Widgets\Console\Human\human-inventory-slotfiller.blp", //背景路径 Bac...

Carlos 3万+

ubuntu恢复分区表——testdisk

testdisk恢复ubuntu分区表testdisk介绍安装testdisk使用testdisk恢复分区表 testdisk介绍 testdisk 具有广泛的功能,包括恢复丢失或损坏的分区和使不能启动磁盘可以重新启动,也经常被用来恢复被误删的文件。 安装testdisk 如果系统分区表被删除,需要使用ubuntu的启动盘,选择try ubnutu模式进入试用系统。 1、可以直接在终端安装testdisk: sudo apt-get install testdisk 通过命令直接打开testdisk: t

ZNestor的博客 6468

网页中窗口文字定时滚动

网页中窗口文字定时滚动 常见于购物网站、资讯网站中 前段时间看了某购物网站 参考其结构写的 实现效果:文字定时向上滚动,至最底层时返回到上层,鼠标移入时暂停滚动 html: &amp;lt;div class=&quot;messagebox&quot;&amp;gt; &amp;lt;ul class=&quot;message&quot;&amp;gt;

EStringDoggi的博客 546

Android自动化新方案:ESP32-C3蓝牙HID模拟触控与手势操作实战(附源码)

本文详细介绍了使用ESP32-C3通过蓝牙HID协议实现Android设备自动化操作的完整方案。该硬件方案成本低廉且能完美规避系统风控,可模拟鼠标移动、点击及复杂手势操作,延迟低于50毫秒,适用于游戏连招和应用测试等场景。文章包含完整的源码实现和性能优化技巧。

kotlin6android的博客 395

STM32按键中断切换红绿蓝灯

通过以上步骤,我们实现了使用STM32的按键中断来切换红绿蓝LED灯的功能。在实际应用中,可能还需要考虑更多的细节,如按键消抖、更精确的延时实现等。但上述代码提供了一个基本的框架和思路,可以根据具体需求进行扩展和优化。希望这篇博客对您有所帮助!

2301_79865940的博客 955

17、网页的缩放、跳转、定位文字、新建窗口和标签页、更换标签页、移动滚动条。

2、当网页中出现多个链接时,可通过一直按Ctrl键同时鼠标左键依次点击多个链接来实现依次打开多个网页而不跳转到多个网页中,即停留在初始页面同时打开多个网页(标签页)的效果。4、当网页窗口中有两个或两个以上的标签页时:(1)可通过鼠标左键按住任何一个导航栏拖动至该网页标题栏以外来实现新建窗口的效果。(2)可通过Shift+鼠标滚轮或鼠标左键按住水平滚动条左右拖动或左、右方向键来实现水平滚动条的左右移动。解:1、在网页中可通过双击标题栏来实现全屏(最大化窗口)或还原缩小(向下还原窗口)页面的效果。

一利糖果的博客 745

IEEE PHM 2012轴承数据实战:用LSTM预测剩余寿命的完整流程与调参心得

本文详细解析了如何利用IEEE PHM 2012轴承数据集和LSTM模型进行轴承剩余寿命预测。从数据预处理、特征工程到LSTM模型架构设计和调参技巧,提供了完整的实战流程。特别分享了FEMTO-ST数据集的处理方法、RUL标签构建策略以及提升预测精度的关键技巧,帮助工程师实现更准确的预测性维护。

weixin_31100517的博客 370

PB窗口使用技巧之增强窗口显示效果

一、窗口最小化时设置动态图标 二、放置闪烁文字 三、提高窗口的打开速度 四、移动不带标题栏的窗口 五、闪烁窗口标题栏 六、给窗口添加自动滚动条功能 窗口是应用程序中一个非常重要的界面,界面设计的大部分工作体现在窗口界面的设计中。所以,在不影响功能的前提下,提倡给用户提供更有提示性的、更美观的界面。常用的手段是动画、声音等,下面介绍这些常用的方法。 一、窗口最小化时设置动态图标 当应...

web开发自学 559

华为OD机试真题 新系统 9月20号 【字符串分组求和】

华为OD新系统机试真题【字符串分组求和】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD机试真题【字符串分组求和】解析。

qq_45776114的博客 658

【AI智能体】全场景AI智能体工作台WorkBuddy实战操作详解

全场景AI智能体工作台WorkBuddy实战操作详解

congge 5679

ListView控件显示 图片加文字说明 并且可以对滚动条进行控制

ListView控件显示 图片加文字说明 并且可以对滚动条进行控制 using System;using System.Windows.Forms;using System.Runtime.InteropServices; namespace ListViewNav{ public partial class Form1 : Form...

weixin_34221036的博客 258

AIO-1126-JD4(RV1126)蓝牙通讯(BLE)

AIO-1126-JD4采用了正基科技推出的一款集成WiFi、蓝牙功能的模组AP6236,支持高速(HS)功能的蓝牙 4.0,集成了 1.5 类功率放大器(PA),并支持低功耗蓝牙(BLE)。提到正基就不得不提下博通。博通和正基是芯片技术与模块制造方面的合作关系,正基科技是中国台湾的公司,在无线通信模块领域有一定的市场份额,博通则是全球领先的有线和无线通信半导体公司。正基把包含博通关键IP的核心芯片和自家的射频部分等封装在一起,即SIP(System In Package)。

w1820020635的博客 1126

java jframe 滚动条_Java窗口(JFrame)从零开始(5)——JPanel面板+JScrollPane面板

JPanel面板package jframe;import java.awt.Container;import java.awt.GridLayout;import javax.swing.*;public class jframe extends JFrame{/****/private static final long serialVersionUID = 1L;public jframe(...

weixin_42380646的博客 804

【Dify系列教程重置精品版】第二章:在Windows上部署Dify

让我们的电脑允许使用Linux系统。有点兴奋是怎么回事?简单来说就是让你的电脑拥有另一个叫做Linux的系统。3.选择“适用于Linux的Windows子系统”与 “虚拟机平台”与“Hyper-V"第1章:安装 wsl (Windows Subsystem for Linux)上一章我们聊了什么是Dify,这一章我们讲一下怎么才能用Dify。好了,我们的环境部署好了,下一章我们正式进入Dify。下载完成后,我们直接一直无脑下一步,安装即可。完成上述步骤,我们就可以开始安装wsl了。我们的虚拟化也是开启的。

xiezhipu的博客 872

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

PB窗口使用技巧

[PB]-窗口使用技巧 **在打开和关闭窗口时进行数据传递 OpenWithParm(windowvar,parmeter{,parent}) 其中windowvar是要打开的窗口名称,可以是window画板中定义的窗口,也可以是脚本中定义的窗口变量;parameter是要传递的参数,只能是String,Numeric或者PowerObject类型,该参数根据类型保存在Message的成员变

冷寂 7328

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

JS实现滚动窗口

<script type="text/javascript"> window.onload = function(){ var speed = 20; var td1 = document.getElementById("td1"); var td2 = document.getElementById("td2"); td2.i

不止于此 983

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

flex 无法定位到软件包_Flex中滚动条无法自动定位到组件底部的问题

在做聊天室群聊窗口文字消息添加的时候,发现一个奇怪的问题,滚动条总是不能到达底部。上网搜了搜,终于发现了问题的所在。当为一个容器添加一个child的时候,很容易想到的做法是:vbox.verticalScrollPosition = vbox.maxVerticalScrollPositon;但是,这是不完全正确的。这种做法是在childAdd事件触发的时候来设置verticalScrollPos...

weixin_39976251的博客 187

如何在div或者table表格中设置长文字自动换行 (亲测)

因为在做前端界面的时候发现,大段大段的文字,在界面上是不会自动换行的,而是直接撑开整个窗口形成滚动条,跑出我们的界面以外去了。 我在网上搜索了很多如何设置自动换行 总结一下有以下属性需进行设置: word-wrap:break-all word-wrap : break-word overflow:hidden 等 我尝试了很多种组合,甚至把这些属性全部加进我的css里。 结果很奇怪,都没有成功...

qq_41979310的博客 985

JS事件高级应用-2

高级拖拽-2: ①与带文字的内容取消选中 ②IE下的兼容(事件捕获) ③带虚线框的拖动(仿windows下窗口的拖动):功能实现:在鼠标按下的时候,会显示虚线框,move的时候拖动的也是虚线框,等到放开的时候红框才会移动到虚线框的位置。是在DOM的操作,move的时候creat一个。 代码实现: 滚动条的实现:就是方块拖拽的简化,去掉y轴方向的数据,控制方块只在父集内运动,就是一个建议的...

qq_41880978的博客 283

略谈如何在对话框创建视图类画图

作者:朱金灿来源:blog.csdn.net/clever101 在对话框上画图可以通过添加控件来进行,但这种画图有一个严重弊端就是画图范围受控件范围控制。最近做一个程序,需要一个数据报告窗口,因为输出的内容比较多,格式不一致(涉及多个表,但每个表的数据要严格对齐),所以如ListControl等控件并不适合。所以我想到在对话框上创建视图类上进行数据显示。

zhoubl668的专栏:远帆,梦之帆! 1380

MATLAB GUI--ScrollBar(动画演示)

function scrollbar() %% 初始化滚动条参数 a = 50; %滚动条左边界与窗口左边界的距离 b = 50; %滚动条右边界与窗口右边界的距离 width = 450; %窗口的宽度 height = 200; %窗口的高度 strDisp = '感时花溅泪,恨别鸟惊心。'; %要滚动显示的字符串 %% 创建隐藏的窗口,并将窗口移到屏幕中间 hFigure = figure('Name', '滚动条设计实例', 'MenuBar', 'none', 'ToolBar.

临风暖阳的博客 952
上一篇: Function object And Binders
下一篇: 使用TinyXML解析XML
ToCpp
博客等级 码龄20年 48粉丝 92原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址