关于splittermoved的信息

http://www.itjxue.com  2023-01-15 05:35  来源:未知  点击次数: 

C# SplitterMoved事件不可用

Console.WriteLine("MouseClick");

换成

MessageBox.Show("MouseClick");

看看

VB运行中实现用鼠标调节控件大小

这是用鼠标调节的List和Textbox,改一下就成你的代码了

ListLeft,Splitter,TextRight 3个控件

Option Explicit

'variable to hold the width of the spltter bar

Private Const SPLT_WDTH As Integer = 3

'variable to hold the last-sized postion

Private currSplitPosX As Long

'variable to hold the horizontal and vertical offsets of the 2 controls

Dim CTRL_OFFSET As Integer

'variable to hold the Splitter bar colour

Dim SPLT_COLOUR As Long

Private Sub Form_Load()

'set the startup variables

CTRL_OFFSET = 5

SPLT_COLOUR = H808080

'set the current splitter bar position to an arbitrary value that will always be outside

'the possibe range. This allows us to check for movement of the spltter bar in subsequent

'mousexxx subs.

currSplitPosX = H7FFFFFFF

ListLeft.AddItem "列表项 1"

ListLeft.AddItem "列表项 2"

ListLeft.AddItem "列表项 3"

ListLeft.AddItem "列表项 4"

ListLeft.AddItem "列表项 5"

'note: VB3 users will need to substitute Chr$(13) chr$(10) for the VB4 constant vbCrLf in the sentence below.

TextRight = "在一些流行的应用程序中,经常见到窗体上有二个相邻的列表框,可以用鼠标任意拉动中间分割条,改变列表框大小。"

End Sub

Private Sub Form_Resize()

Dim x1 As Integer

Dim x2 As Integer

Dim height1 As Integer

Dim width1 As Integer

Dim width2 As Integer

On Error Resume Next

'set the height of the controls

height1 = ScaleHeight - (CTRL_OFFSET * 2)

x1 = CTRL_OFFSET

width1 = ListLeft.Width

x2 = x1 + ListLeft.Width + SPLT_WDTH - 1

width2 = ScaleWidth - x2 - CTRL_OFFSET

'move the left list

ListLeft.Move x1% - 1, CTRL_OFFSET, width1, height1

'move the right list

TextRight.Move x2, CTRL_OFFSET, width2 + 1, height1

'move the splitter bar

Splitter.Move x1 + ListLeft.Width - 1, CTRL_OFFSET, SPLT_WDTH, height1

End Sub

Private Sub Splitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbLeftButton Then

'change the splitter colour

Splitter.BackColor = SPLT_COLOUR

'set the current position to x

currSplitPosX = CLng(X)

Else

'not the left button, so... if the current position default, cause a mouseup

If currSplitPosX H7FFFFFFF Then Splitter_MouseUp Button, Shift, X, Y

'set the current position to the default value

currSplitPosX = H7FFFFFFF

End If

End Sub

Private Sub Splitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

'if the splitter has been moved...

If currSplitPosX H7FFFFFFF Then

'if the current position default, reposition the splitter and set this as the current value

If CLng(X) currSplitPosX Then

Splitter.Move Splitter.Left + X, CTRL_OFFSET, SPLT_WDTH, ScaleHeight - (CTRL_OFFSET * 2)

currSplitPosX = CLng(X)

End If

End If

End Sub

Private Sub Splitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

'if the splitter has been moved...

If currSplitPosX H7FFFFFFF Then

'if the current postition the last position do a final move of the splitter

If CLng(X) currSplitPosX Then

Splitter.Move Splitter.Left + X, CTRL_OFFSET, SPLT_WDTH, ScaleHeight - (CTRL_OFFSET * 2)

End If

'call this the default position

currSplitPosX = H7FFFFFFF

'restore the normal splitter colour

Splitter.BackColor = H8000000F

'and check for valid sizings.

'Either enforce the default minimum maximum widths for the left list, or, if within range, set the width

If Splitter.Left 60 And Splitter.Left (ScaleWidth - 60) Then

ListLeft.Width = Splitter.Left - ListLeft.Left 'the pane is within range

ElseIf Splitter.Left 60 Then 'the pane is too small

ListLeft.Width = 60

Else

ListLeft.Width = ScaleWidth - 60 'the pane is too wide

End If

'reposition both lists, and the splitter bar

Form_Resize

End If

End Sub

如何使用ComponenetOne创建桌面布局控件

创建可嵌套的桌面布局控件

首先在设计时,从工具箱拖拽C1SplitContainer控件到窗体,可以创建复杂的多面板布局,并且可以在窗体上调整内容的大小,甚至折叠内容。C1SplitContainer与标准的SplitContainer控件类似,但是它可以支持两个以上的面板、标题、视觉样式,以及可折叠的按钮。

它可以生成如下图的界面:

创建VisualStudio风格的停靠布局控件

首先设计时,从工具箱拖拽C1DockingTab控件到窗体,它可以创建一个熟悉的、包含灵活的行为与式样的标签控件界面。然后对标签进行定向、调整大小以及设计样式。还可以创建停靠和浮动标签。

它可以生成如下的界面:

创建可缩放的网格布局控件

C1Sizer:是一个具有网格布局的容器控件。在对C1Sizer的大小进行调整时,其中所包含的控件可以吸附到网格线并相应地伸展。

首先在设计时,拖拽C1Sizer控件到窗体,创建与分辨率无关的、可调整大小的窗体。这个网格布局管理器扩展了.NET Framework提供的基本布局能力,可以象WPF和Silverlight的Grid控件一样调整控件的大小以填充窗体。

接着在C1Sizer里添加行和列,并通过IsFixedSize属性设置行列是否是固定大小,IsSplitter属性设置是否可以Split。还可以给行列设置背景色。

调用C1Sizer.SplitterMoved事件,确保当鼠标拖动Splitter的时候,能够正确操作。该C1Sizer如下所示:

C1Sizerlight:

它是一个非可视化组件,它可以跟踪窗体的大小和位置。在调整窗体大小时,C1SizerLight组件可以按比例调整其包含的所有控件的大小,这样,窗体就可以在任何分辨率下保持它的外观。

首先拖拽一个Panel到窗体,并且将自定义的Form放入到Panel里,拖拽C1Sizerlight控件到窗体,就具有即时调整大小的功能。

如图所示,调整这个Form的大小,窗体内的控件会随之调整大小。

有没有林肯总统简介,要英文版的,急啊,拜托各位~~~~~~~~~~~~~

I Introduction

Print this section | Edit this section

Abraham Lincoln (1809-1865), 16th president of the United States (1861-1865) and one of the great leaders in American history. A humane, far-sighted statesman in his lifetime, he became a legend and a folk hero after his death.

Lincoln rose from humble backwoods origins to become one of the great presidents of the United States. In his effort to preserve the Union during the Civil War, he assumed more power than any preceding president. If necessity made him almost a dictator, by fervent conviction he was always a democrat. A superb politician, he persuaded the people with reasoned word and thoughtful deed to look to him for leadership. He had a lasting influence on American political institutions, most importantly in setting the precedent of vigorous executive action in time of national emergency.

II Early Life

Print this section | Edit this section

Abraham Lincoln's ancestry on his father's side has been traced to Samuel Lincoln, a weaver who emigrated from Hingham, England, to Hingham, Massachusetts, in 1637. The president's forebears were pioneers who moved west with the expanding frontier from Massachusetts to Berks County, Pennsylvania, and then to Virginia. Abraham's father, Thomas Lincoln, was born in Rockingham County in backcountry Virginia in 1778. In 1781 Thomas Lincoln's father, who was also named Abraham, took his family to Hughes Station on the Green River, 32 km (20 mi) east of Louisville, Kentucky. In 1786 a Native American killed the first Abraham Lincoln while he was at work clearing land for a farm in the forest.

Thomas Lincoln continued to live in Kentucky. He saw it develop from a frontier wilderness into a rapidly growing state. But like his ancestors he preferred the rugged life on the frontier. In a brief autobiography written for a political campaign, Lincoln said that his father “even in childhood was a wandering labor boy, and grew up literally without education. He never did more in the way of writing than to bunglingly sign his own name.”

Despite Thomas Lincoln's apparent shiftlessness, he became a skilled carpenter, and he never lacked the basic necessities of life. At one time he owned title to two farms. He always possessed one or more horses. He paid his taxes, and, like his neighbors, he accepted jury duty and militia duty when called.

On June 12, 1806, Thomas Lincoln married Nancy Hanks. Little is known about Abe Lincoln's mother except that she came from a very poor Virginia family. She was completely illiterate and signed her name with an X. After their marriage the Lincolns moved from a farm on Mill Creek in Hardin County, Kentucky, to nearby Elizabethtown. There Thomas Lincoln earned his living as a carpenter and handyman. In 1807 a daughter, Sarah, was born.

In December 1808 the Lincolns moved to a 141-hectare (348-acre) farm on the south fork of Nolin Creek near what is now Hodgenville, Kentucky. On February 12, 1809, in a log cabin that Thomas Lincoln had built, a son, Abraham, was born. Later the Lincolns had a second son who died in infancy.

When Abraham Lincoln was two, the family moved to another farm on nearby Knob Creek. Life was lonely and hard. There was little time for play. Most of the day was spent hunting, farming, fishing, and doing chores. Land titles in Kentucky were confused and often subject to dispute. Thomas Lincoln lost his title to the Mill Creek farm, and his claims to both the Nolin Creek and Knob Creek tracts were challenged in court. In 1816, therefore, the Lincolns decided to move to Indiana, where the land was surveyed and sold by the federal government.

In the winter of 1816 the Lincolns took their meager possessions, ferried across the Ohio River, and settled near Pigeon Creek, close to what is now Gentryville, Indiana. Because it was winter, Thomas Lincoln immediately built a crude, three-sided shelter that served as home until he could build a log cabin. A fire at the open end of the shelter kept the family warm. At this time southern Indiana was a heavily forested wilderness. Lincoln described it as a “wild region, with many bears and other wild animals in the woods.” Later some of Nancy Hanks's relatives moved near the site the Lincolns had chosen, and a thriving frontier community gradually developed.

In 1818 an epidemic of the milk sick broke out. This was not actually a disease. It was caused by drinking poisoned milk from cows that had eaten the wild snakeroot plant. One of the first victims of the milk sick was Nancy Hanks Lincoln. She died October 5, 1818. The next year, Thomas Lincoln journeyed to Elizabethtown, Kentucky, and married Sarah Bush Johnston, a widow with three children. Abe Lincoln was very much attached to his kind stepmother, and he later referred to her as “my angel mother.”

One of the most important jobs on a frontier farm was clearing the forest. Young Abe Lincoln quickly became skilled with an axe. In his autobiographical sketch written in the third person, Lincoln stated that “the clearing away of surplus wood was the great task ahead. Abraham, though very young, was large for his age, and had an axe put in his hands at once. From that till within his twenty-third year, he was almost constantly handling that most useful instrument.” One of his chores with an axe was to make fence rails by splitting poles. Later, as a presidential candidate, Lincoln was known as the Railsplitter.

A Education

Edit this section

When his father could spare him from chores, Lincoln attended an ABC school. Such schools were held in log cabins, and often the teachers were barely more educated than their pupils. According to Lincoln, “no qualification was ever required of a teacher beyond readin', writin', and cipherin', to the Rule of Three.” Including a few weeks at a similar school in Kentucky, Lincoln had less than one full year of formal education in his entire life.

Abe's stepmother encouraged his quest for knowledge. At an early age he could read, write, and do simple arithmetic. Books were scarce on the Indiana frontier, but besides the family Bible, which Lincoln knew well, he was able to read the classical authors Aesop, John Bunyan, and Daniel Defoe, as well as William Grimshaw's History of the United States (1820) and Mason Locke Weems's Life and Memorable Actions of George Washington (about 1800). This biography of George Washington made a lasting impression on Lincoln, and he made the ideals of Washington and the founding fathers of the United States his own.

By the time Lincoln was 19 years old, he had reached his full height of 1.93 m (6 ft 4 in). He was lean and muscular, with long arms and big hands that gave him an awkward appearance. Although he had remarkable strength, he never liked farm work. He preferred instead the easy congeniality that he found at the general store in nearby Gentryville. A neighbor recalled “Abe was awful lazy, he would laugh and talk and crack jokes and tell stories all the time.”

The Pigeon Creek farm was near the Ohio River, and Lincoln often earned money ferrying passengers and baggage to riverboats waiting in midstream. In 1828, when he was 19, he was hired by the local merchant James Gentry to take a cargo-laden flatboat down the Mississippi River to New Orleans.

B Move to Illinois

Edit this section

In 1830 another epidemic of milk sick was rumored to be breaking out in Indiana. Already the Hanks family had moved west to Illinois, and their enthusiastic letters describing their new home rekindled the pioneering spirit in Thomas Lincoln. In March 1830 the Lincoln family set out for the Illinois country. They settled at the junction of woodland and prairie on the north bank of the Sangamon River, 16 km (10 mi) west of what is now Decatur, Illinois. Lincoln helped his father build a log cabin and fence in 4 hectares (10 acres) to grow corn. Then he hired out to neighbors, helping them to split rails. That year, Lincoln attended a political rally and was persuaded to speak on behalf of a local candidate. It was his first political speech. A witness recalled that Lincoln “was frightened but got warmed up and made the best speech of the day.”

In 1831 Lincoln made a second trip to New Orleans. He was hired, along with his stepbrother and a cousin, by Denton Offutt, a Kentucky trader and speculator, to build a flatboat and take it down the Mississippi with a load of cargo. The pay was 50 cents a day plus a fee of $60. According to legend, Lincoln saw his first slave auction in New Orleans. Referring to the practice of slavery, he is thought to have said, “If I ever get a chance to hit that thing, I'll hit it hard.”American Civil War

more...

C New Salem

Edit this section

Denton Offutt was impressed with Lincoln's abilities. When they returned to Illinois, he hired Lincoln as a clerk in a general store in New Salem, a small community near the growing town of Springfield, Illinois. The pay was $15 a month, plus the use of the store as sleeping quarters.

Although he was a newcomer in New Salem, Lincoln soon became one of its most popular citizens. He won the respect and fellowship of the local ruffians by besting their strong man, Jack Armstrong, in a wrestling match. And he soon earned the friendship of the more peaceable citizens of the community by his good humor, intelligence, and integrity. As in all small towns of the day, the general store was an informal meeting place. Customers who came to buy at Offutt's store would usually linger to exchange anecdotes and jokes with his clerk. Lincoln, an avid newspaper reader, enjoyed the popular frontier pastime of discussing politics. Because he could read and write, Lincoln was often called on to draw up legal papers for the less literate citizens of New Salem.

Clerking in a store gave Lincoln time to read all the books, newspapers, and political tracts that came his way. Always endeavoring to improve his education, he studied books on grammar and acquired a lifelong taste for the poetry of English poet and playwright William Shakespeare and Scottish poet Robert Burns. Novels, however, held little interest for him, and he later admitted that he never was able to finish one in his entire life. Lincoln also joined the local debating society. A member had this reaction to Lincoln's first debate: “A perceptible smile at once lit up the face of the audience, for all anticipated the relation of some humorous story. But he opened up discussion in splendid style, to the infinite astonishment of his friends. . . . He pursued the question with reason and argument so pithy and forcible that all were amazed.”

III Early Political Career

Print this section | Edit this section

In the spring of 1832, Lincoln decided to run for a seat in the Illinois house of representatives. This was a logical step for Lincoln to take, for on the frontier a young man with ability and ambition could rise rapidly in politics.

A month after Lincoln announced his candidacy, Offutt's general store went bankrupt and Lincoln found himself without a job. But almost immediately, Governor John Reynolds of Illinois called for volunteers to put down a rebellion of the Native American Sauk (or Sac) and Fox peoples led by Chief Black Hawk. Lincoln enlisted at once and, because of his popularity, was elected captain of his company. When his term expired, he reenlisted as a private. In all, he served three months, but saw no actual fighting. However, Lincoln took great pride in this brief military career.

A First Campaign

Edit this section

When Lincoln returned to New Salem in 1832, election day was two weeks away. It was a presidential election year, and political parties had formed around the contending candidates. Followers of Andrew Jackson, who was seeking a second term as president, called themselves Democrats. Followers of U.S. Senator Henry Clay of Kentucky called themselves National Republicans and later Whigs. Lincoln supported Clay, who had long been his political idol. He remained a faithful Whig until the party disintegrated over the question of slavery in the 1850s.

Lincoln's program, as published in the Sangamon, Illinois, Journal, called for the construction of canals and roads, better schools, and a low interest rate to stimulate local economic growth. In his brief campaign, Lincoln spoke from tree stumps in village squares, visited farmers in their homes and fields, and shook hands and exchanged stories with as many people as he could meet. Nevertheless, he was defeated. There were 13 county candidates running for four legislative seats. Lincoln finished eighth. In his own precinct, however, he got 277 out of 300 votes even though the precinct voted overwhelmingly to support the Democrat, Jackson, for the presidency.

B Postmaster

Edit this section

After his defeat, Lincoln opened a general store in New Salem with William F. Berry as his partner. But Berry misused the profits, and in a few months the venture failed. Berry died in 1835, leaving Lincoln responsible for debts amounting to $1100. It took him several years to pay them off.

After the general store failed, Lincoln was appointed postmaster of New Salem. The appointment came from Jackson's Democratic administration. Lincoln's Whig views were well known, but, as Lincoln explained it, the postmaster's job was “too insignificant to make his politics an objection.” As postmaster, Lincoln earned $60 a year plus a percentage of the receipts on postage. He ran an informal post office, often doing favors for friends, such as undercharging them for mailing letters. The job gave him time to read, and he made a habit of reading all the newspapers that came through the office. To augment his income, he became the deputy surveyor of Sangamon County.

C Illinois Legislator

Edit this section

In 1834 Lincoln again ran for representative to the Illinois legislature. By then he was known throughout the county, and many Democrats gave him their votes. He was elected in 1834 and reelected in 1836, 1838, and 1840. As a member of the Whig minority he became the protégé of the Whig floor leader, Representative John T. Stuart of Springfield. When Stuart ran for a seat in the Congress of the United States in 1836, Lincoln replaced him as floor leader. Stuart also encouraged Lincoln to study law, which Lincoln did between legislative sessions.

Lincoln's main achievement as a state legislator was the transfer of the state capital from Vandalia to Springfield. In this effort he acted as the leader of Sangamon County's delegation of seven representatives and two state senators, a group called the Long Nine because they were all tall men. Lincoln devised a strategy whereby the Sangamon delegation supported the projects of other legislators in return for their support of Springfield as the capital city. In American politics this kind of aid is called logrolling, a term derived from frontier families' tradition of helping each other to build log cabins.

Lincoln's other votes in the state legislature reflected his Whig background. He supported the business interests in the state and defended the pro-business national platform of Henry Clay. Lincoln's experience in the Illinois legislature sharpened his political skills. He was adept at logrolling, skilled in debate, and expert in the art of political maneuver.

In 1837 Lincoln took his first public stand on slavery when the Illinois legislature voted to condemn the activities of the abolition societies that wanted an immediate end to slavery by any means. Lincoln and a colleague declared that slavery was “founded on both injustice and bad politics, but the promulgation of abolitionist doctrine tends rather to increase than abate its evil.” Lincoln was against slavery, but he favored lawful means of achieving its destruction. Throughout his political career, Lincoln avoided extreme abolitionist groups.

(责任编辑:IT教学网)

更多

推荐Mail服务器文章