|
Doesn't help me, I know this stuff already. You might want to reply to the OP, though.
Hopefully, he doesn't just cut and paste your code and expect it to work! And, yes, I still say this should have been a consideration when the control was designed and not an after thought.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I already added the porperty and set my control style to support transparency, I just want to know how to make the opacity in the painting code and (Absof***inlutely) give me the key so thank you all,
and i am not just cutting and pasting the code
|
|
|
|
|
I'm happy to have helped you,
and i don't mind if you paste the code, do as you want!
But i maybe the code doesn't work (as Dave suggested), i didn't test it ...
For more info, check www.bobpowel.net!
That's a great site (though CP still is better;P)
|
|
|
|
|
Hi to all,
Is there any way to lock desktop after certain ammount of time.Like in xp ,it get automatically log off and ask for login.Just like that cant we make our login screen using winform (vb.net) to log in??
|
|
|
|
|
Why don't you just log the user out ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I want login window under control of vb.net app
|
|
|
|
|
Are you asking how you can disaply your own login form when XP locks the desktop and the user tries to unlock it?
You can't do this without replacing the GINA.DLL. Here...[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for this GINA dll,i will go through it still i ll explain my req once gain..
sir actual requirment is that ,i want develop a vb.net app to just login a computer (let xp os) after certain amount of time i want to hide all desktop and to show my own login window by which user can login .just like app use in cyber cafe to browse net ,like there a login window user can login through it and desktop get locked after logout or after time limit till new user get login.just like this i want to this...!
|
|
|
|
|
You have two options
1. write a GINA dll.
2. write an app that has keyboard and mouse hooks so you can stop those things responding until your app lets them. Seeing as VB.NET can interop with system DLLs, you may even be able to do this in VB.NET instead of C++.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
HAI LAKS HERE ,I HAVE TWO DOUBTS
1.I WANT TO KNOW HOW CAN I GIVE ANIMATION TO THE FORM(FOR EXAMPLE ZOOMING THE LABEL ON FORM LOAD )
2.I WANT TO PLACE 3 TEXTBOXES AND ONE GRID CONTROL ON THE SAME FORM WHILE INSERTING OR UPDATING OR DELETING RECORDS IN/FROM DATABASE, SIMULTANEOUSLY I WANT TO SEE THE RECORDS IN THE GRID CONTROL .I WANT TO WRITE THIS CODING IN A BUTTON(S),PLEASE GIVE ME REPLY HOW CAN I DO THIS
|
|
|
|
|
LAYEEQ AHMED KHAN wrote:
HAI LAKS HERE
what the hell does this mean ?
LAYEEQ AHMED KHAN wrote:
I HAVE TWO DOUBTS
I have one. Why are you SHOUTING ?
LAYEEQ AHMED KHAN wrote:
I WANT TO KNOW HOW CAN I GIVE ANIMATION TO THE FORM(FOR EXAMPLE ZOOMING THE LABEL ON FORM LOAD )
By drawing it yourself.
LAYEEQ AHMED KHAN wrote:
PLEASE GIVE ME REPLY HOW CAN I DO THIS
With code. You're asking someone to completely write a solution that is so simple, if you can't find the way to do it online, or at least give it a go and ask specific questions when you get stuck, you probably should not be programming computers at all ( even in VB ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
LAYEEQ AHMED KHAN wrote:
ZOOMING THE LABEL ON FORM LOAD
YOU CAN DO THAT BY USING LARGE FONT. WHEN THE FORM LOADS, IT WILL SHOW YOU LARGE LABEL.
<italic>Work hard, Work effectively.
|
|
|
|
|
Hello everyone,
I want to print multipage tiff file on a selected printer through PrintDocument class in VB.NET. What is the simple way to that.
Thanks.
|
|
|
|
|
Hi
I'm working with VBA for MS access. A visually impaired user has high contrast set on his pc and when printing snapshot reports they appear in high contrast.
To resolve the problem I was trying to write a sub routine that would check if high contrast was set and if true switch it off before printing and then switch it back on after printing.
I was using the SystemParametersInfo api. The code I was using is below.
const SPI_GETHIGHCONTRAST = 66
const SPI_SETHIGHCONTRAST = 67
const SPIF_SENDWININICHANGE = &H2
const SPIF_UPDATEINIFILE = &H1
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" ( _
ByVal uAction As Long, _
ByVal uParam As Long, _
ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Sub TestCode()
a = SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, 0, SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
MsgBox a
End Sub
Not sure what I'm doing wrong but the SystemParametersInfo function returns if high contrast is on or off.
Any help with this would really appreciated.
|
|
|
|
|
const SPI_GETHIGHCONTRAST = 66
Private Const HCF_HIGHCONTRASTON = &H1
Private Type HIGH_CONTRAST
cbSize As Long
dwFlags As Long
lpszDefaultScheme As Long
End Type
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" ( _
ByVal uAction As Long, _
ByVal uParam As Long, _
lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Private m_bHighContrast As Boolean
Sub TestCode()
' check for high contrast
Dim tHC As HIGH_CONTRAST
tHC.cbSize = Len(tHC)
tHC.lpszDefaultScheme = 0
SystemParametersInfo SPI_GETHIGHCONTRAST, Len(tHC), tHC, 0
m_bHighContrast = ((tHC.dwFlags And HCF_HIGHCONTRASTON) = HCF_HIGHCONTRASTON)
'Debug.Print m_bHighContrast
MsgBox m_bHighContrast
End Sub
|
|
|
|
|
Thanks for the sample that works great. Can the same API be used to set the high contrast on and/or off at run time.
|
|
|
|
|
Your welcome, and Yes you can use it to 'set' the contrast also,
From MSDN:
An application can turn on the high-contrast option by calling SystemParametersInfo with uiAction set to SPI_SETHIGHCONTRAST, uiParam set to the size of the HIGHCONTRAST structure, and the pvParam parameter set to a pointer to a HIGHCONTRAST structure that contains the high-contrast parameters that you want to use. You should set the HCF_HIGHCONTRASTON flag in the dwFlags member of the ACCESSTIMEOUT structure that you pass to SystemParametersInfo.
hope this helps..
|
|
|
|
|
Brilliant, I've got that working now. Many thanks.
Const SPI_SETHIGHCONTRAST = 67
Private Const HCF_HIGHCONTRASTON = &H1 'HighContrast is currently on.
Private Type HIGH_CONTRAST
cbSize As Long
dwFlags As Long
lpszDefaultScheme As Long
End Type
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" ( _
ByVal uAction As Long, _
ByVal uParam As Long, _
lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Sub Test()
' Pass a value of false to switch high contrast off or true to switch it on
Call SetHighContrast(False)
End Sub
Sub SetHighContrast(Contrast as Boolean)
Dim tHC As HIGH_CONTRAST
tHC.cbSize = Len(tHC)
tHC.lpszDefaultScheme = 0
If Contrast = True Then
tHC.dwFlags = HCF_HIGHCONTRASTON
ElseIf Contrast = False Then
tHC.dwFlags = 0
End If
SystemParametersInfo SPI_SETHIGHCONTRAST, Len(tHC), tHC, 0
End Sub
|
|
|
|
|
Good work and
Your welcome, again.
progload
|
|
|
|
|
Dear jonathan15
ur code was very useful for me thanks alot..but :
How can I show own message box on top of word document? in your code that message box is behind the word document and user have to click on vb form to visit it.
|
|
|
|
|
Is there anyway to show network information such as Ip address in text boxes
BINARY
|
|
|
|
|
use the system.net.dns refrence u can get many method
Ishak
|
|
|
|
|
How do I open a folder Path using a Listview? At the same time, is it possible to have treeview in the ListView? You have the Folder names and when you click on the folders there are child files that pop out and as you click on them they open in a RichTextBox?
|
|
|
|
|
|
pls help me. i wonder why my server cannot send a message to my client and my client cannot read from server. anyone pls help me to debug or give me tip to do it by showing wats the command to write.My deadline for this project is comong soon. Pls help me. thanks a lot.
here is my source code
server:
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.IO
Imports System.Text
Public Class Form1
Inherits System.Windows.Forms.Form
Private Client As TcpClient
Private Listener As Socket
Private RemotePort As Integer = 1337
Private RemoteHost As String = "localhost"
Dim add As IPAddress = IPAddress.Parse("220.255.41.189")
Public Shared Connected As New ManualResetEvent(False)
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub blisten_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles blisten.Click
Listener = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
Listener.Blocking = False
Listener.Bind(New IPEndPoint(add, RemotePort))
Listener.Listen(1)
ListBox1.Items.Add("Waiting for connection...")
Listener.BeginAccept(New AsyncCallback(AddressOf AcceptConnection), Listener)
End Sub
Public Sub AcceptConnection(ByVal ar As IAsyncResult)
ListBox1.Items.Add("Connection established.")
Connected.Set()
Dim serverSock As Socket = CType(ar.AsyncState, Socket)
Dim clientSock As Socket = serverSock.EndAccept(ar)
Dim buffer(1024) As Byte
While True
If (clientSock.Poll(100, SelectMode.SelectRead)) Then
Dim count As Integer = clientSock.Receive(buffer)
ListBox1.Items.Add(System.Text.Encoding.ASCII.GetString(buffer, 0, count))
End If
End While
End Sub
Private Sub bsend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bsend.Click
Dim Stream As NetworkStream = Client.GetStream()
Dim dataSend As [Byte]() = System.Text.Encoding.ASCII.GetBytes(TextBox1.Text)
'Send Message
Stream.Write(dataSend, 0, dataSend.Length)
Stream.Flush()
End Sub
End Class
my client source code:
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.IO
Imports System.Text
Public Class Form1
Inherits System.Windows.Forms.Form
Private Client As TcpClient
Private Listener As Socket
Private RemotePort As Integer = 1337
Private RemoteHost As String = "localhost"
Dim add As IPAddress = IPAddress.Parse("220.255.41.189")
Public Shared Connected As New ManualResetEvent(False)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub bconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bconnect.Click
Try
Client = New TcpClient
Client.Connect(add, RemotePort)
Catch ex As Exception
ListBox1.Items.Add("No route to host.")
End Try
End Sub
Private Sub bsend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bsend.Click
Dim Stream As NetworkStream = Client.GetStream()
Dim dataSend As [Byte]() = System.Text.Encoding.ASCII.GetBytes(TextBox1.Text)
'Send Message
Stream.Write(dataSend, 0, dataSend.Length)
Stream.Flush()
End Sub
Public Sub AcceptConnection(ByVal ar As IAsyncResult)
ListBox1.Items.Add("Connection established.")
Connected.Set()
Dim serverSock As Socket = CType(ar.AsyncState, Socket)
Dim clientSock As Socket = serverSock.EndAccept(ar)
Dim buffer(1024) As Byte
While True
If (clientSock.Poll(100, SelectMode.SelectRead)) Then
Dim count As Integer = clientSock.Receive(buffer)
ListBox1.Items.Add(System.Text.Encoding.ASCII.GetString(buffer, 0, count))
End If
End While
End Sub
|
|
|
|