OVH Cloud OVH Cloud

affichage Form

3 réponses
Avatar
JCM
Bonjour =E0 tous

mon probl=E8me :

J'ai un form1 affich=E9e =E0 l'=E9cran, j'ai une formInfo=20
affich=E9e =E9galement, quand je click sur form1 je voudrais=20
que formInfo destin=E9e =E0 afficher des infos relatives au=20
click form1 reste affich=E9e

Est-ce possible ?

Cordialement
Jean Claude

3 réponses

Avatar
ng
Salut,

Peut être cherches-tu à faire ca :

'//Form Form1 :
Option Explicit

Private Sub Form_Click()
Call formInfo.AfficheInfos("Exemple d'infos : Position de Form1=" &
Me.Left & "," & Me.Top)
End Sub

Private Sub Form_Load()
Call Load(formInfo)
Call formInfo.Move(Me.Left + Me.Width, Me.Top)
Call formInfo.Show
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call Unload(formInfo)
End Sub

'//Form formInfo
Option Explicit

Private Sub Form_Load()
Me.AutoRedraw = True
End Sub

Public Sub AfficheInfos(strInfos As String)
Call Me.Cls
Me.Print vbCrLf & vbTab & "Infos : " & strInfos
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = (UnloadMode <> vbFormCode)
End Sub


--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



JCM a écrit :

Bonjour à tous

mon problème :

J'ai un form1 affichée à l'écran, j'ai une formInfo
affichée également, quand je click sur form1 je voudrais
que formInfo destinée à afficher des infos relatives au
click form1 reste affichée

Est-ce possible ?

Cordialement
Jean Claude


Avatar
le_troll
Bonjour,

Avec tout ça "Me", tu devrais arriver à la faire rester à l'écran ta
formInfo en la liant avec le focus de ta form1

Load FormX

FormX.Show , Me



Me.Show

Me.SetFocus


A part ça tu peux employer les grands moyens, lol:
Quand Form1 a le focus:

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As
Long, ByVal cy As Long, ByVal wFlags As Long) As Long



Dim Resultat As Long

Const Flags = &H2 Or &H1 Or &H40 Or &H10

'

Sub Form_Load()

'toujours visible

Resultat = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0, Flags)

'

'n'est plus toujours visible QUAND FORM1 PERD LE FOCUS

Resultat = SetWindowPos(Form1.hwnd, -2, 0, 0, 0, 0, Flags)



--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours raison !
------------------------------------------


"JCM" a écrit dans le message de news:
c00601c47a05$f892c550$
Bonjour à tous

mon problème :

J'ai un form1 affichée à l'écran, j'ai une formInfo
affichée également, quand je click sur form1 je voudrais
que formInfo destinée à afficher des infos relatives au
click form1 reste affichée

Est-ce possible ?

Cordialement
Jean Claude
Avatar
JCM
Bonjour

et merci à tous deux pour vos réponses, c'est OK

Cordialement
JCM
-----Message d'origine-----
Bonjour,

Avec tout ça "Me", tu devrais arriver à la faire


rester à l'écran ta
formInfo en la liant avec le focus de ta form1

Load FormX

FormX.Show , Me



Me.Show

Me.SetFocus


A part ça tu peux employer les grands moyens, lol:
Quand Form1 a le focus:

Private Declare Function SetWindowPos Lib "user32" (ByVal


hwnd As Long,
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y


As Long, ByVal cx As
Long, ByVal cy As Long, ByVal wFlags As Long) As Long



Dim Resultat As Long

Const Flags = &H2 Or &H1 Or &H40 Or &H10

'

Sub Form_Load()

'toujours visible

Resultat = SetWindowPos(Form1.hwnd, -1, 0, 0, 0, 0,


Flags)

'

'n'est plus toujours visible QUAND FORM1 PERD LE FOCUS

Resultat = SetWindowPos(Form1.hwnd, -2, 0, 0, 0, 0,


Flags)



--
Merci, @+, bye, Joe
troll75 AROBASE iFrance POINT com
------------------------------------------
Ce message est plein de virus "certifiés"
Le_Troll, éleveur de Trolls depuis César, qui disait:
Avec une hache, celui qui tient le manche a toujours


raison !
------------------------------------------


"JCM" a écrit dans le


message de news:
c00601c47a05$f892c550$
Bonjour à tous

mon problème :

J'ai un form1 affichée à l'écran, j'ai une formInfo
affichée également, quand je click sur form1 je voudrais
que formInfo destinée à afficher des infos relatives au
click form1 reste affichée

Est-ce possible ?

Cordialement
Jean Claude


.