zhengmoushuc536zheng 在 2020-11-26 08:45:24 上传
说明:C for richTextBox text box to add paragraph styles, when entered a period of lagging behind, will automatically add a paragraph label, a small dot, can also be defined as the other style: richTextBox1. Multiline = true;RichTextBox1. ScrollBars = RichTextBoxScrollBars. Vertical;RichTextBox1. SelectionBullet = true;
开发平台:Others | 大小:12KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:45:11 上传
说明:C listBox and interaction with the added value generated list of textBox, input in the textBox text box, click the add button, the value will be added to the list of the above listBox, repeat this step, can generate rich content of listBox selection list, click the listBox arbitrary data items, you can choose the data.In terms of implementation, add data before, need to determine whether the input comply with regulations: the if (textBox1. Text = = "") {MessageBox. Show (" add project can't be empty");} else {/ / after the Textbox value added to the ListBox: listBox1. Items. The Add (textBox1. Text);TextBox1. Text = "";}
开发平台:Others | 大小:21KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:45:05 上传
说明:C check whether contains the specified element in the sequence: private void Frm_Main_Load (object sender, EventArgs e) {List People = new List ();/ / to create personnel list for (int I = 1;I < 10;I) {People. The Add (new Person (I, "User0 i.T oString ()));} bool result = People. The Contains (new Person (3, "User03"));/ / check if the sequence contains the specified element / / display the query results label1. Text = "data sources: People (containing 9 elements, elements of the ID values are 1, 2, 3,..., 9) ";/ / data source label2. Text = "query expressions: the Contains (new Person (3," User03 ")) ";/ / query expression/operation label3. Text = "query result:" is the result. The ToString ();/ / query results}
开发平台:Others | 大小:12KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:44:46 上传
说明:C sine value calculation, using Angle trigonometric function numerical calculation, this example is closely related to database operations, using trigonometric functions in SQL query function of cloud computing in the SQL data filtering: define queries the database information, return the DataTable object: private DataTable GetAngle () {string P_Str_ConnectionStr = the string. Format (/ / create a database connection string @ "server = WIN - GI7E47AND9RLS;The database = db_TomeTwo;Uid = sa;The PWD = ");String P_Str_SqlStr = the string. Format (/ / create an SQL query string "SELECT Angle as Angle, SIN (Angle * PI () / 180) as sine value FROM tb_Angle");SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter (/ / create the data adapter P_Str_SqlStr P_Str_ConnectionStr);The DataTable P_dt = new DataTable ();/ / create the data table P_SqlDataAdapter. The Fill (P_dt);/ / return P_dt populate the data table;/ / return data table}
开发平台:Others | 大小:24KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:44:40 上传
说明:Mouse and keyboard hook, class C author: by wang, simulated the mouse, click and press, bounce, double click, scroll wheel, press the keyboard, the keyboard in the pop-up, and other functions, and suitable for display the mouse x, y coordinates, and the mouse wheel.The source code for the development of Visual studio 2013, if you can't open this solution.Please directly consult AdrHookDemo/bin/debug/directory program running effect.AdrHook is the concrete implementation AdrHookDemo is the sample
开发平台:Others | 大小:63KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:44:34 上传
说明:C read Dxf file data, drawing button - to read Dxf files to data in picturebox, in which the test - cannot draw???In ReadOrWrite folder, are two operation class of DXF file, complete the function of writing and reading DXF file, defines the read two lines each time, the head section of the header read DXF file, the main body of information, read, read spline spline polyline line information, reading circle circle more, read the line line, write the ellipse ellipse information, etc.This example as a whole, is still a simple action of DXF file, a right foundation about description: read DXF file debugging step through, a look at a result;Find their general location, using messageBox. Show (), to display the various parameters, see whether it is right!!!!!
开发平台:Others | 大小:30KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:44:28 上传
说明:Visual C 2012 data file generated Word form, the content in the DataGridView exported to the Word, the realization of the program you need to use to several Office programming libraries: Interop. Office. DLL, Interop. VBIDE. DLL, Interop. Word. DLL.Implementation steps: instantiate SqlConnection connection object, create a database connection, SqlDataAdapter object, filling a DataSet object, set the data source for the DataGridView control.Then instantiate the Word document object, statement Word selection, establish Word object, the data generated Word form file, set the column width, use a for loop output column header data, finally the records in the output control.
开发平台:Others | 大小:168KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:43:39 上传
说明:After a C implementation dateTimePicker calendar control, click the pop-up date selection box, more classic operation method and interface style.When users click on the date selection button, will perform the following function code: private void Form1_Load (object sender, EventArgs e) {dateTimePicker1. Format = DateTimePickerFormat. Custom;DateTimePicker1. CustomFormat = "MMMM dd yyyy - DDDD";Label1. Text = dateTimePicker1. Text;} the date selection form of pop-up as shown in the figure below, complete source code, please download.
开发平台:Others | 大小:12KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:43:01 上传
说明:Delphi record file read and write, the program of database, actually also is not file to read and write procedures, just use the main window, the child window by value in the middle of it.Input data in the child window, is determined, the data will be added to the main window of StringGrid, and then by modifying the commands, read out data from StringGrid, modified save, illustrates the file read and write the content of the operation process.
开发平台:Others | 大小:11KB | 下载0次
zhengmoushuc536zheng 在 2020-11-26 08:42:36 上传
说明:This source has three related example of VC operating table, each one belongs to the relatively simple kind, show the registry operation skills, interested in downloading the source code package.Hkeys hkeys;/ / define the hkeys, to close at the end of the query.LPCTSTR data_Set = "Software \ Microsoft \ Windows \ CurrentVersion \";/ / child key objectives / / open path data_Set related hkeys, the first parameter to the root key name, the second parameter table./ / said to allow access to the location of the keys, the third argument must be a 0, KEY_READ said, in the form of a query./ / access to the registry, hkeys, save the handle to open the key function.Long retopen = (: : RegOpenKeyEx (HKEY_LOCAL_MACHINE, data_Set, 0, KEY_READ,
开发平台:Others | 大小:67KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:42:14 上传
说明:VC basic mouse mouse messages - judgment, operation method: press the left mouse button, move the mouse to draw the ellipse, until the release left!Void CBaseMouseDemoView: : OnMouseMove (UINT nFlags, CPoint point) {if (bDrag) {ptUp = point;/ / record mouse current location methods like DrawCircle ();/ / draw new circle} the CView: OnMouseMove (nFlags, point);{} void CBaseMouseDemoView: : methods like DrawCircle () Invalidate (false);CClientDC dc (this);/ / get the DC CRect the rect.GetClientRect (the rect);/ / customer acquisition window area CBrush brush (RGB (255255255));Dc. FillRect (the rect,
开发平台:Others | 大小:19KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:42:02 上传
说明:VC 6.0 custom splitter bar, that is, form of space bar, the window is divided into several parts, used to display different content, the pane view as CStaticSplitWnd4View, the panel size can change by dragging, but we can change size dynamically through the menu command, pane view for CView2, the panel size can change by dragging, pane view CView3 and CView4 can drag to change the view through the separation of the senior colonel in this sample article separated after a primary beautification, but also shows users, how to through the splitter bar to a fixed columns pane view, the size of the article how to make the space does not support drag, etc.
开发平台:Others | 大小:25KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:55 上传
说明:VC 6.0 custom SplitWndView function, static split window, realize arbitrary segmentation window, this will be a complete instance of VC Windows separated into four small window, similar to the iFrame WEB development framework, each column frame can use the mouse to drag the size of the separated regions, in order to separate the source function from the actual effect of view, each view has text annotation in small Spaces.In some comprehensive information management system, sometimes need to display window is divided into areas, this example illustrates the window of the split, is a good example.
开发平台:Others | 大小:24KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:43 上传
说明:The lifetime of MFC procedures, call as a member function in order to show the number of idle processing, program eventually display Onldle has been called the number of times: / / define a string object cstrings strCount, strTem;StrTem = "OnIdle has been called the number of times is:";/ / access device context, in order to write words on pDc = GetWindowDC ();/ / Format string strCount. The Format (" % s % d ", strTem, lCount);/ / output text pDc - > TextOut (100100, strCount);/ / refresh the view of the client area Invalidate ();/ / fortify resources ReleaseDC (pDc);/ / delay so that he could see display text (milliseconds) Sleep (100);
开发平台:Others | 大小:58KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:36 上传
说明:VC 6.0 message processing and custom message dialog box usage, by overloading function OnCmdMsg so that will not be able to deal with the main framework of the command mode dialog box, possess the function of response to the main frame of the command.The second is that the use of the custom message.Overloading OnCmdMsg after changing the window title, custom message parameters: x = % d, y = % d ".
开发平台:Others | 大小:86KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:30 上传
说明:VC 6.0 keyboard and mouse menu programming instance data, do is a floating menu, click the right mouse button in the window area, can pop-up right-click menu, and the menu bar, this is the place where one is floating in the mouse click, written before, the relevant definition menu: CMenu menu;/ / define menu. The menu LoadMenu (IDR_FLOATMENU);/ / load the CMenu floating menu resource * pM = menu. The GetSubMenu (0);/ / menu first as a floating CPoint pt;The GetCursorPos (
开发平台:Others | 大小:59KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:24 上传
说明:VC CFileException exception handling usage example, catch (CFileException * e) {switch (e - > m_cause) {case CFileException: : fileNotFound: {strMessage. Format (" an exception occurs when open the file (try/catch) : at the specified position is not found the file % s
开发平台:Others | 大小:22KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:18 上传
说明:VC source desktop cool dog music lyrics effect effect of imitation QQ music player, such as the table shows the lyrics, but this project seems to lack the libraries in the Bin, compile failed, but there are a lot of comments in the code, refer to the code, there may be other harvest.This procedure function description: 1. Demonstrate how to create a desktop lyrics show 2. The progress of the unrealized karaoke effects, this source code is only change the text color in the color, change can achieve it.3. On the XP VC6.0 debugging through
开发平台:Others | 大小:15KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:11 上传
说明:Examples of VC Trasform analysis data, involves the DataGrid ADODC controls such as the use of methods, before the test, please add a good database.Program debugging, please pay attention to the following: (1) in the program to select ResourceView view, open the "Dialog" node "IDD_TRASFORMDATA_DIALOG" Dialog resource, right-click the ADO Data control, in the pop-up menu, select the Properties menu item, select the general TAB, click the "generate" button, on the connection TAB, click "..."Button, open the Access database in the current folder, click the "test connection" button, click the "ok" button.(2) right click on the DataGrid control, in the pop-up menu, select the Properties menu item, select All TAB, in the DataSource item Value Value of the corresponding to the choice of IDC ADODC1 items.
开发平台:Others | 大小:65KB | 下载0次
yongs8083yongs8083 在 2020-11-26 08:41:05 上传
说明:Example of vc to descending data query, also includes the SQL statements, descending after the search, the content of the query to display in the DataGrid, this example requires combining database can be achieved.A database query is as follows: the UpdateData (true);M_adodc. SetRecordSource (" select * from shuzcx order by desc age ");M_adodc. Refresh ();
开发平台:Others | 大小:48KB | 下载0次