|
just put e.Cancel=True in the else part of your code
If (MsgBox("Are you sure, you want to Delete the record ", MsgBoxStyle.YesNo, "Delete Record?") = MsgBoxResult.Yes) Then
MsgBox("Record Deleted")
Else
e.Cancel = True
End If
|
|
|
|
|
hi all,
i am developing program with vb.net 2005
i am using combobox and i set the AutoCompleteMode property to Suggest, so when i type something to there, it will appear a list for every the content that likes what i type..
the problem is.. when we click on the list... it will return keycode 13 or enter... how can i disable that...
is anybody have the answer?
Thanks...
|
|
|
|
|
You can check for keypress event for combobx and do nothing is keycode is 13...
Regards,
Nilesh
|
|
|
|
|
Hello,
I am not agree ur point. Because In all control's Keypress event thier will be event displayer commonly known as 'e'. if we use e we will get to properties like e.handler, e.keychar. From this e.keychar which will tell the current pressing/pressed key character.
From that we get 13,43,46 asci values which we currently using if we go for asc(e.keychar).
13 - for enter
32 - spacebar
46 - pullstop / dot
Senthil.S
Software Engineer.
|
|
|
|
|
hmm.. but i need the 13 keypress event ....
|
|
|
|
|
Hello,
It is easy if u follow the changes in the properties of combobox.
1. FlatStyle - System
2. AutoCompleteSource - ListItems
3. AutoCompleteMode - SuggestAppend
after completion of this. I think ur problem may solve
Senthil.S
Software Engineer
|
|
|
|
|
if i use the SuggestAppend AutoCompleteMode property...
when i use the mouse scroll it will not display all item in the combo box..
it just display item that like w type when we scroll it..
|
|
|
|
|
I want to temporarily disable the UAC, when i launch my Application and enable when i close the application.
I want this can be do in vb6.
Please give me any idea....
Thanks & Regards
Kumaran
|
|
|
|
|
File this under 'not a chance in hell'. UAC is about protecting the user from apps dong unauthorised things. What use would it be, if you could call an API that turns it off, while your app does whatever it likes ? ( no, I don't think you're writing anything malicious, but that's not the point )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Becoz. I have my application while launch it has to register the component before executing exe.
That's why iam asking you. if you have any code please refer me.
Thanks & Regards
Kumaran
|
|
|
|
|
Well, apart from the fact that I'd never use VB6 for *anything*, my answer stands. I'm not saying you're writing anything bad, I am pointing out that even if you were not using an antiquated and dead language, you still would not find support for turning off a security feature using code, it's just not going to happen.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Kumaran21cen wrote: I have my application while launch it has to register the component before executing exe.
That should be done during the installation phase. Installers run with elevated privilege.
Kumaran21cen wrote: That's why iam asking you. if you have any code please refer me.
As Christian already said there is no code that will disable security procedures without the proper rights in place. If you want to disable a security feature you must already have the rights to do so. In order to get those rights you must go through UAC.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
What part of "IT CAN'T BE DONE" is so hard to understand??
Your code is not allowed to just "turn off" the UAC whenever it wants.
|
|
|
|
|
hi all,
I want to make a program that can list all current connections and block/allow a program from connecting to the internet.
can anyone give me a tip where can I start ?
I've been doing some tricks with the xp sp2 firewall, but now I want to develop something that doesn't depend on it.
thanks
|
|
|
|
|
Your first going to have to learn to write drivers for Windows. Dig up the Windows Device Driver Development Kit, learn C++, learn to write drivers, then learn how Window's network stack works and write a driver that will fit between two layers of the stack so you can intercept all the network traffic and analyze it before it gets sent up the rest of the network stack.
THEN, you can write your app to analyze the traffic and modify it.
|
|
|
|
|
for the first: i'm from germany so my english isn't very good. sorry.
ok, i want to create a network connection between two clients. that you know better what i want, think on a chat!
ok, thats the code of the microsoft dokumentation:
TCP-Listener
<br />
Imports System<br />
Imports System.IO<br />
Imports System.Net<br />
Imports System.Net.Sockets<br />
Imports System.Text<br />
Imports Microsoft.VisualBasic<br />
<br />
<br />
Class MyTcpListener<br />
<br />
Public Shared Sub Main()<br />
<br />
Dim server As TcpListener<br />
server=nothing<br />
Try<br />
' Set the TcpListener on port 13000.<br />
Dim port As Int32 = 13000<br />
Dim localAddr As IPAddress = IPAddress.Parse("127.0.0.1")<br />
<br />
server = New TcpListener(localAddr, port)<br />
<br />
' Start listening for client requests.<br />
server.Start()<br />
<br />
' Buffer for reading data<br />
Dim bytes(1024) As Byte<br />
Dim data As String = Nothing<br />
<br />
' Enter the listening loop.<br />
While True<br />
Console.Write("Waiting for a connection... ")<br />
<br />
' Perform a blocking call to accept requests.<br />
' You could also user server.AcceptSocket() here.<br />
Dim client As TcpClient = server.AcceptTcpClient()<br />
Console.WriteLine("Connected!")<br />
<br />
data = Nothing<br />
<br />
' Get a stream object for reading and writing<br />
Dim stream As NetworkStream = client.GetStream()<br />
<br />
Dim i As Int32<br />
<br />
' Loop to receive all the data sent by the client.<br />
i = stream.Read(bytes, 0, bytes.Length)<br />
While (i <> 0) <br />
' Translate data bytes to a ASCII string.<br />
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i)<br />
Console.WriteLine("Received: {0}", data)<br />
<br />
' Process the data sent by the client.<br />
data = data.ToUpper()<br />
Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(data)<br />
<br />
' Send back a response.<br />
stream.Write(msg, 0, msg.Length)<br />
Console.WriteLine("Sent: {0}", data)<br />
<br />
i = stream.Read(bytes, 0, bytes.Length)<br />
<br />
End While<br />
<br />
' Shutdown and end connection<br />
client.Close()<br />
End While<br />
Catch e As SocketException<br />
Console.WriteLine("SocketException: {0}", e)<br />
Finally<br />
server.Stop()<br />
End Try<br />
<br />
Console.WriteLine(ControlChars.Cr + "Hit enter to continue....")<br />
Console.Read()<br />
End Sub 'Main<br />
<br />
End Class 'MyTcpListener <br />
TCP-Client
<br />
Shared Sub Connect(server As [String], message As [String])<br />
Try<br />
' Create a TcpClient.<br />
' Note, for this client to work you need to have a TcpServer <br />
' connected to the same address as specified by the server, port<br />
' combination.<br />
Dim port As Int32 = 13000<br />
Dim client As New TcpClient(server, port)<br />
<br />
' Translate the passed message into ASCII and store it as a Byte array.<br />
Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes(message)<br />
<br />
' Get a client stream for reading and writing.<br />
' Stream stream = client.GetStream();<br />
Dim stream As NetworkStream = client.GetStream()<br />
<br />
' Send the message to the connected TcpServer. <br />
stream.Write(data, 0, data.Length)<br />
<br />
Console.WriteLine("Sent: {0}", message)<br />
<br />
' Receive the TcpServer.response.<br />
' Buffer to store the response bytes.<br />
data = New [Byte](256) {}<br />
<br />
' String to store the response ASCII representation.<br />
Dim responseData As [String] = [String].Empty<br />
<br />
' Read the first batch of the TcpServer response bytes.<br />
Dim bytes As Int32 = stream.Read(data, 0, data.Length)<br />
responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes)<br />
Console.WriteLine("Received: {0}", responseData)<br />
<br />
' Close everything.<br />
stream.Close()<br />
client.Close()<br />
Catch e As ArgumentNullException<br />
Console.WriteLine("ArgumentNullException: {0}", e)<br />
Catch e As SocketException<br />
Console.WriteLine("SocketException: {0}", e)<br />
End Try<br />
<br />
Console.WriteLine(ControlChars.Cr + " Press Enter to continue...")<br />
Console.Read()<br />
End Sub 'Connect<br />
questions:
1. What do i have to do now that this code works? (for exampe on my own PC, 127.0.0.1)
2. In which order do i have to call the subs of the two classes (TCP Listener and TCP Client)?
3. Which parameters must the sub of TCP-Client have? (i think the message-parameter can be choosed by random...any string. But i have problems with the server-parameter! What should i fill in there?)
Greetz
|
|
|
|
|
Hi there..
How does one, call a button's click event from a subroutine..
Well i've got:
Sub cmdAClick(sender as system.Object, e as system.EventArgs)
...... code
End Sub
Sub mnuMainClick(sender.......)
Q: i wanna call cmdAClick
in vb6 "call cmdA_Click"
Please help
Thanx
|
|
|
|
|
cmdAClick(me, eventargs.empty)
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanx Christian
Thanx a mil....
|
|
|
|
|
Hello,
use this code n send me the reply abt the status..
'*********** This is main Procedure *********
Private Sub mnuMain_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuMain.Click
Call Button1_Click(sender, e)
End Sub
'*********** This is sub Procedure *********
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("asf")
End Sub
Senthil.S
Software Engineer
|
|
|
|
|
Thanx Senthil
It works! Coool. Thanx again.
The code Christian sends also works! Thank You all
|
|
|
|
|
Hi Everyone,
I was trying to follow the article
Step by Step: Calling C++ DLLs from VB application - Part 2
By Hans Dietrich.( given in code project)
But I am not using visual basic 6.0. I have visual studio on my pc.
Now when I run the application Its getting an error
"An unhandled exception of type 'System.EntryPointNotFoundException' occurred in VB2.exe"
Additional information: Unable to find an entry point named 'GetCpuSpeed' in DLL 'C:\Documents and Settings\Jyothi\My Documents\Visual Studio 2005\Projects\DLL2\debug\DLL2.dll'
I follow the the steps as shown and when I type dumpbin/exports dll2.dll at the command prompt of visual studio I get an other error:
Dump of file DLL2.dll
DUMPBIN: fatal error LINK1181: Cannot open file input file 'Dll2.dll'
I am struggling to understand where the error is and is it because I am using visual studio 2005 and not visual basic 6.0. can anyone please help me solve this issue. Do I have to move .dll and .lib files to the VB application folder where .exe file is located.
All I want is to create C++ DLL files and call them from visual Basic 2005.
Any help would be appriciated
Jyothi
|
|
|
|
|
jyothim wrote: ecause I am using visual studio 2005 and not visual basic 6.0.
VB.NET and VB6 are totally different. You will use p/invoke to call a C++ dll. www.pinvoke.net is full of examples from windows dlls, and has some explanation also.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
Thank you for the reply. Can you be more specific coz, I really couldn't find any examples on working with dlls on the www.pinvoke.net. Sorry for bothering but I am just a beginner with no knowledge on .net. I hope you dont mind but I am currently doing converting FORTRAN code to C++ and trying to create a GUI for it. I thought I can use VB and call C++ programs using DLL concept. Please let me know if you can help me find a proper guide to solve my problem with DLLs.
Thanks
Jyothi
|
|
|
|
|
Hello
I try to use Crystal Report
but i don't know how to call and to work with
it urgent so if someone can help me to do one report as begening
this will be very helpfull
Thanks in advance
Assaf
|
|
|
|