我想弄清楚如何在网格上显示主要组件。基本上一切都显示在图片中。有一个标题 - 程序的上部,水平变化时可以拉伸。表单的主要部分(也很灵活,在中间),其中已经显示了文本输入字段和按钮。帮我弄清楚如何将标题和正文放在程序窗口中。
主页
/
user-310003
OneGuy's questions
现在可以向群组发送自定义消息吗?如果是这样,请提供一个示例请求。
有一个 A 类的对象,它有一个值为 0 的变量 a。是否可以默认将此值分配给函数参数func?示例变体:
struct A{
int a = 0;
int func(int a = a){
return a;
}
};
我目前在 Visual Studio C++ 2017 中工作。有没有办法在编辑器中更快地编写基本语言结构?例如,他在他的代码中写了“for ++i n”,他将其扩展为我
for(int i = 0; i < n; ++i){
}
PS我不知道这个动作叫什么,我尽我所能解释了。如果可能,请告诉我们它是什么以及它是否适用于其他 Visual Studio 编辑器。
有一种方法适用于双端队列对的队列。对于某些输入数据,该方法必须适用于该对的第一部分或第二部分。例子:
void max3(deque<pair<int, int>> & q, [first or second] ) {
int a = q[0].[first or second];
cout << a << endl;
}
有一个带有多个叶子的 Options 类和另一个 Form1 类。在 Form1 类中创建 Options 类的一个实例。如何开始使用此实例的字段(Array、ColorPenBrush、Thickness)?
class Options
{
public List<Point> Array { get; set; }
public List<Color> ColorPenBrush { get; set; }
public List<String> Thickness { get; set; }
}
class Form1
{
Options options = new Options();
//далее пример работы
Point point1;
point1.X = 100;
point1.Y = 200;
options.Array.Add(point1);
}
熟悉 Linux。如果一切顺利,我想创建一个输出 DONE 的递归复制别名。
$ alias cpRI="cp -ri $ $ && echo "DONE""
如何让用户输入目录的路径来代替美元符号?
我目前正在使用 C# 表单。我有两种形式。我希望只要按下第一个表单中的按钮,就会打开第二个表单,并在输出此表单后执行代码。我使用了 Shown 方法,但由于某种原因它不起作用。仅当您将其放在 MessageBox 方法的最开始时才包含它。
private void Form2_Shown(object sender, EventArgs e)
{
float h;
int division = 10;
Graphics gr = pictureBox1.CreateGraphics();
Pen p = new System.Drawing.Pen(System.Drawing.Color.Gray);
//Разметка
h = 0;
while (h <= pictureBox1.Width)
{
gr.DrawLine(p, h, 0, h, pictureBox1.Height);
h += division;
}
h = 0;
while (h <= pictureBox1.Height)
{
gr.DrawLine(p, 0, h, pictureBox1.Width, h);
h += division;
}
//Координатная ось
p.Color = Color.Red;
gr.DrawLine(p, pictureBox1.Width / 2, 0, pictureBox1.Width / 2, pictureBox1.Height);
gr.DrawLine(p, 0, pictureBox1.Height / 2, pictureBox1.Width, pictureBox1.Height / 2);
}
有一个结构有两个参数:一个单词(str)和一个数字(cnt;不要问为什么,没关系)。已创建此结构的数组。我的目标是交换(str, cnt)这个数组中的集合,如果结果证明这些集合cnt是相等的,但按字母顺序,一个小于另一个。一旦我输入一个新char s的替换,它就会抛出一个错误“表达式必须对左侧值的更改有效”。问题是什么?
const int WORDLEN = 80;
const int MAXWORDS = 100;
struct Elem {
char str[WORDLEN + 1];
int cnt;
};
Elem list[MAXWORDS];
int last = 0;
void Letter() {
char s[WORDLEN + 1];
for (int i = 0; i < last; i++) {
for (int j = i; j < last - 1; j++) {
if (list[i].cnt == list[j + 1].cnt) {
if (list[i].str > list[j + 1].str) {
s = list[i].str;
list[i].str = list[j + 1].str;
list[j + 1].str = s;
}
}
}
}
}

