Bonjour tout le monde,
Dans le cadre de mon stage en entreprise, je dois faire la chose suivante :
Je suis dans un formulaire dans lequel il y a deux textBox contenant un numéro fixe et un numéro portable.
Je souhaite lancer une impression dans laquelle je dois faire apparaitre un des deux numéros.
Pour cela, mon code est le suivant :
Cela ne fonctionne pas, donc j'ai essayé d'afficher dans un label que j'ai placé sur le formulaire et là il reste vide :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 If (tbx_com_cli_fixe.Text <> "" And tbx_com_cli_gsm.Text = "") Then ev.Graphics.DrawString(tbx_com_cli_fixe.Text, special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) ElseIf (tbx_com_cli_gsm.Text <> "" And tbx_com_cli_fixe.Text = "") Then ev.Graphics.DrawString(tbx_com_cli_gsm.Text, special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) ElseIf (tbx_com_cli_gsm.Text <> "" And tbx_com_cli_fixe.Text <> "") Then ev.Graphics.DrawString(tbx_com_cli_fixe.Text, special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) ElseIf (tbx_com_cli_gsm.Text = "" And tbx_com_cli_fixe.Text = "") Then ev.Graphics.DrawString("00000", special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) End If
Et l'impression ne fonctionne pas non plus.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Select Case tbx_com_cli_gsm.Text Case "" Select Case tbx_com_cli_fixe.Text Case "" lbl_test_tel.Text = "00000" ev.Graphics.DrawString("00000", special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) Case Is <> "" lbl_test_tel.Text = tbx_com_cli_fixe.Text ev.Graphics.DrawString(tbx_com_cli_fixe.Text, special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) End Select Case Is <> "" Select Case tbx_com_cli_fixe.Text Case "" lbl_test_tel.Text = tbx_com_cli_gsm.Text ev.Graphics.DrawString(tbx_com_cli_gsm.Text, special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) Case Is <> "" lbl_test_tel.Text = tbx_com_cli_fixe.Text ev.Graphics.DrawString(tbx_com_cli_fixe.Text, special, Brushes.Black, xpos + largeurcol + 238, ypos + 342) End Select End Select
Voyez-vous une solution pour résoudre mon problème ?
Toute réponse sera la bienvenue
Merci à tous pour votre aide.
Partager