我在项目中的一些资源很好,使用字符串路径工作正常但如果我将项目移动到另一个目录或另一台计算机,它将停止工作.
我需要在字符串变量中获取项目的resources文件夹的路径,
像这样的东西
C:\Users\User1\Documents\<projects folder>\<project name>\Resources\
Run Code Online (Sandbox Code Playgroud)
提前致谢.
我的组合框中的某些项目长度超过 20 个字符,我编写了此代码以使它们变小并添加“...”,但它\xc2\xb4s 不起作用。\n通过示例而不是“comboboxitemnumberthird”,它看起来像this:"comboboxitemnu..." 以适应组合框的大小
\n\ni=0;\ndo\n{\n var item = comboBox1.Items[i].ToString();\n if (item.Length >= 17) // not sure about this part\n {\n item = item.Substring(0, item.Length - 6) + "...";\n }\n i++;\n} while (i < comboBox1.Items.Count); //finishes when theres not any other item left on the combobox\nRun Code Online (Sandbox Code Playgroud)\n\n请让我知道出了什么问题。提前致谢。
\n