 |
11樓
巨大八爪鱼
2015-11-28 14:37
窗口布局: 
|
 |
12樓
巨大八爪鱼
2015-11-28 14:38
Ctrl + D键设置的Tab键访问顺序:  一定要把第一个文本框的号码设为比其他TAB可切换控件的号码小,这样程序启动后光标才能默认落在第一个文本框中。
|
 |
13樓
巨大八爪鱼
2015-11-28 14:39
最后一个文本框的Read Only(只读)要设置为True: 
|
 |
14樓
巨大八爪鱼
2015-11-28 14:40
 这是给文本框绑定变量的方法。
|
 |
15樓
巨大八爪鱼
2015-11-28 14:42
 Category要选择Value类型,变量类型为CString,变量名为mString1。 窗口上其他的文本框类似。 设置后程序中就可以直接读取文本框中的内容了。 UpdateData();是把文本框中的内容更新到变量中。 UpdateData(false);是把变量中的内容显示到文本框中。
|
 |
16樓
巨大八爪鱼
2015-11-28 14:42
 程序属性值
|
 |
17樓
巨大八爪鱼
2015-11-28 14:44
|
 |
可以哦。
|
 |
20樓
巨大八爪鱼
2015-12-19 10:26
可以用C语言库函数把insert函数改写成更简单且更容易理解的版本: #include <stdio.h> #include <stdlib.h> #include <string.h>
void insert(char *s1, const char *s2) { int len1 = strlen(s1); int len2 = strlen(s2); int pos; char *ch = strchr(s1, *s2); if (ch == NULL) // when not found memcpy(s1 + len1, s2, len2 + 1); // including '\0' at the end else { pos = *ch - *s1; memmove(ch + len2 - 1, ch, len1 - pos + 1); // including '\0' at the end memcpy(ch, s2, len2); } }
int main(int argc, char *argv[]) { char str[50] = "abcdefgh"; char s2[5] = "d45"; insert(str, s2); puts(str); strcpy(str, "abcdef"); strcpy(s2, "45"); insert(str, s2); puts(str); strcpy(str, "definition"); strcpy(s2, "desk"); insert(str, s2); puts(str); return 0; }
|