Ivo
Member
- Joined
- Feb 8, 2022
- Messages
- 18
- Programming Experience
- Beginner
How to pass the array string to that paint methode:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
using System.IO;
namespace SignalWatch
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
string[] IP = new string[40];
private void frmMain_Load(object sender, EventArgs e)
{
LoadIPdata();
}
private void LoadIPdata()
{
for (int i = 1; i < 40; i++)
{
IP[i] = File.ReadLines("IP.txt").Skip(i - 1).First(); // How to pass the IP[string from Arry] to the
//methode private void Label_1_Paint(object sender, PaintEventArgs e) ????? to put in to e.Graphics.DrawString(IP[0], Myfont, Mybruhs, 0, 0);
}
return;
}
private void Label_1_Paint(object sender, PaintEventArgs e)
{
Font Myfont = new Font("Sans Serif", 9);
Brush Mybruhs = new System.Drawing.SolidBrush(System.Drawing.Color.White);
e.Graphics.TranslateTransform(3, 57);
e.Graphics.RotateTransform(-90);
e.Graphics.DrawString(IP[0], Myfont, Mybruhs, 0, 0);
}