|
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
|
|
|
|
|
For sending messages and files over network you can see many articles and you can get refrences that is fully managed .so you can use in your project.if you are in neck.
eample :unolibs.Net.dll its vey useful.search here in articls or googling it
Ishak
|
|
|
|
|
Hallo together,
I want to write a VB6 application using TAPI interface.
It should show the list of TAPI providers on the PC and e.g. receive TAPI call events from a specific TSP.
Therefore I need the TAPI SDK (controls, drivers, samples, etc.) for Windows 2000 as mentioned on this site. But it is not available anymore on the Microsoft site.
Would be anyone so kind and would send me this sdk by email to falk.hertel@t-online.de?
I hope that I will be able to code this app then!...
Thank you so much.
Best wishes, Falk
|
|
|
|
|
The TAPI SDK is part of the Platform SDK. Noone on this earth is going to email that to you 'cause it can weigh in at over 400MB.
You can start the web install for the Platform SDK from here[^]. Keep in mind that this SDK targets C++, not VB, so most of the examples will, obviously, be in C++.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hallo Dave,
thanks for your answer and the given link. But this one I know. You can only get the new Platform SDK. There is a service to buy older versions but you have to have an credit card. I don't have and need such a crd. In Europe we use EC-cards much more.
The Americans cannot imagine that this is the fact. They don't support direct banc transfer as well. Don't understand that!...
So I need the help of others - like you.
I found out that it actually seems not to be possible to get a separate TAPI package but only the big Platform SDK - as you mentioned.
So are you able to send me this CD? I will pay for your kindness in advance onto your banc account of course!! Tell me the costs.
See, any platform SDK from last year or older is okay. VB6 still was supported that time and therefore VB6 examples etc. will be included.
Which version do you have?
Thank you very much for your help, Dave.
Best wishes, Falk
|
|
|
|
|
softterrier@web.de wrote:
There is a service to buy older versions but you have to have an credit card. I don't have and need such a crd. In Europe we use EC-cards much more.
The Americans cannot imagine that this is the fact. They don't support direct banc transfer as well. Don't understand that!...
We use Debit card attached to bank accounts, they're not too much different.
softterrier@web.de wrote:
So are you able to send me this CD?
Nope.
I always download the thing so I don't have to CD's and never worry about getting them.
The last version that still supported VB6 was the February 2003 Edition, which you can only get on CD's. You would have a better chance finding someone in the UK that still has the CD's or can get the UK CD's for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I am new to vb.net can anyone tell me how to populate the all the child nodes present in a parent node of a treeview control into listview when a parent node of a treeview is selected or clicked
thanks in advance
Kalyan
|
|
|
|
|
Doesn't the parent node have a child nodes property you can use ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
No it does'nt have that property
|
|
|
|
|
There's no way to iterate through the child nodes of a particular node ? That would make that control complete crap. It would also mean it can't be done.
The WinForms TreeControl has a TreeNode class, which represents one node in the view. Like the node you're talking about. That node has a property called ChildNodes. That is what you need.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I don't want to add nodes to treeview i want to get all the child nodes added to listview when a parent node of a treeview is clicked
|
|
|
|
|
That's exactly what Christian is suggesting you to do, iterate through the child nodes and add them to the listview. Something like
void AddToList(TreeNode parent)
{
foreach(TreeNode child in parent.Nodes)
{
listView.Items.Add(child.Text);
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|