这是new
我的形式的方法:
Public Sub New(ByVal ConnectionString As String, ByVal ConSql As SqlClient.SqlConnection, ByVal Daman As Array, ByVal SDate As Integer, ByVal FDate As Integer)
Threading.Thread.CurrentThread.TrySetApartmentState(Threading.ApartmentState.STA)
' This call is required by the Windows Form Designer.
'Error Appear in this line
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Sto_TypeFormFrameTableAdapter.Connection.ConnectionString = ConnectionString
Me.Sto_typeformTableAdapter.Connection.ConnectionString = ConnectionString
con = ConSql
com.Connection = con
ConNew = ConnectionString
DamaneCod = Daman
Start = SDate
Final = FDate
Fill()
End Sub
Run Code Online (Sandbox Code Playgroud)
当我创建表单的新对象时,该InitializeComponent
命令会出错. …
我已经创建了自定义视图以在其中绘制自定义气泡,我想在自定义视图上放一些文本。我使用drawTextOnPath,但是它不能正常工作,我希望文本逐行显示。
自定义视图-气泡
Paint paint = new Paint();
paint.setColor(Color.BLACK);
paint.setAntiAlias(true);
paint.setStrokeWidth(2);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setPathEffect(new CornerPathEffect(15) );
paint.setStyle(Paint.Style.FILL_AND_STROKE);
paint.setDither(true);
paint.setShader(new LinearGradient(0, 0, 0, getHeight(), Color.BLACK, Color.WHITE,
Shader.TileMode.MIRROR));
Path path = new Path();
paint.setShadowLayer(4, 2, 2, 0x80000000);
path.moveTo(myPath[0].x, myPath[0].y);
for (int i = 1; i < myPath.length; i++){
path.lineTo(myPath[i].x, myPath[i].y);
}
path.close();
canvas.clipPath(path);
canvas.drawPath(path, paint);
canvas.save();
paint = new Paint();
paint.setColor(Color.WHITE);
canvas.drawTextOnPath(MessageBody, path, 10, 10, paint);
Run Code Online (Sandbox Code Playgroud)
谢谢。