|
Each Control has its own Region
You Should Make an Elliptic Region For You Button if You Use Button.
But if You Use Usercontrol.You have to set the region to an elliptic one and also make some changes in mouseclick event of usercontrol to make your control having click event like a button.
AEK
|
|
|
|
|
Hi,
I'm using an USB API writed in C++. I've declared each function in VB.net and it works ok. But I'd like to have a VB.net event when USB data is available (like VB COMM control). I thought to make an user control with a timer control inside, where I could evaluate a variable and depending on the state, raise an vb.net event, but I guest it is not a good programming practice.
Could anyone suggest me any solution ?
Thanks
coadorna2003.
german
|
|
|
|
|
A Timer is a lousy way to go. It generates a ton of execution overhead since the code attached to the Tick event has to constantly poll to see if there's data available.
The best option is if the library you're using exposes this functionality. Somehow, I doubt it, because that's something that normally left up to the driver of the USB device to supply.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Sorry to ask what is probably an elementary question, but I've searched the site and other places for this. Clearly, my general understanding of the underlying architecture is a bit weak.
Is there a particular advantage to sharing methods through modules rather than instantiating them from a class? I found for instance that synclock() doesn't work in a module, but works fine from a class. That got me to wondering about why modules are used at all.
|
|
|
|
|
Modules are there for backwards compatibility with the older version of VB. Going forward it would be best to use classes. If you want to use the features that modules really used to be used for (a place to put functions that could be called from anywhere) consider a cl;ass with shared members instead.
|
|
|
|
|
Hello every one,
I created a project with ClassLibrary(Visual Basic 2005) and I added a ComClass file to it .In ComClass there are some functions and when I run this project it creates a dll file and I can access to all of functions that I defined in ComClass .I call this dll in a Macro in Word(microsoft office 2003) ,I can see all of functions that I define in my ComClass file but I need to access to a global variable in this ComClass ,I defined a public variable in top of ComClass file but I can not see and access to it from out of project.I mean I can not see global variable from Macro that uses this dll.
If any one knows how can I use global variable in ComClass please Inform me.
I'd appreciated for any help.
yours sincerely.
Orchid
|
|
|
|
|
Hi,
How do I set both bold, italics and underline style to my text box value dynamically.
Regards
Rams.
Be simple and Be sample.
|
|
|
|
|
A regular TextBox does not support formatted text. You can use a RichTextBox instead.
---
Year happy = new Year(2007);
|
|
|
|
|
Actually it does support it:
Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
|
|
|
That is formatting of the text box, not formatting of the text box value as the OP asked for.
But, then again, perhaps the OP doesn't want what he asks for. That is not so uncommon...
---
Year happy = new Year(2007);
|
|
|
|
|
how to compress a file in vb.net?
meaning
having a 'txt' file ,how can i compress it
Regards
Ramy
|
|
|
|
|
Do you have .NET 2.0 ? I think it has zip support.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
yep i noticed that...
but can you just tel me how to zip the folder ,coz i m fed up with that?
thx
Regards
Ramy
|
|
|
|
|
|
thx for this,
i went into this
but i noticed that in 'create a Zip file'
Dim zip As New Chilkat.Zip()
is not defined
any help for that?
-- modified at 9:26 Monday 22nd January, 2007
Sorry found the DLL
Regards
Ramy
|
|
|
|
|
You could also have a look at Planet source code for another zip class source code
Steve Jowett
|
|
|
|
|
can u hlpe me with the following
i went into the following
i was told that the Dll is in
http://www.chilkatsoft.com/downloads.asp
but i cant enter this site (restricted) can u tell me where can i get the DLL chilkat.dll from (other then the above site) ?
or can u simply upload it ?
thx
Regards
Ramy
|
|
|
|
|
i have download this code
but i noticed that 'Chilkat' needs a license after 30 days?
am i right?
i can use this Dll just for 30 days for free?
Regards
Ramy
|
|
|
|
|
Probably, yes.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi,
Is there any way in which i can change the background color of the tool bar on a form in a windows application?
Please let me knw.
Thanks
Riz
|
|
|
|
|
Which version of Visual Studio?? In 2005 (.NET Framework 2.0) you just have to change the BackColor property of the ToolStrip object to the color you want.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all,
Can anybody send me the code to list out all the oracle servers in the network and all the oracle databases in a particular server. I mean, i need to do it through ODBC. The code for doing the same for SQL is as follows,if possible pls point out what all changes I need to add to get the oracle list, i have tried out the "DRIVER= Oracle ODBC Driver" change.That is not working.
'code starts here
'Note : Include "DRIVER= Oracle ODBC Driver" for the SQL_DRIVER_STR variable in the code below and try it.
'class file
Imports System
Imports System.Data.SqlClient
Imports System.Text
Imports System.Runtime.InteropServices
Public Class SqlServersDatabases
#Region "ODBC32 API"
Private Const SQL_HANDLE_ENV As Short = 1
Private Const SQL_HANDLE_DBC As Short = 2
Private Const SQL_ATTR_ODBC_VERSION As Integer = 200
Private Const SQL_OV_ODBC3 As Integer = 3
Private Const SQL_SUCCESS As Short = 0
Private Const SQL_NEED_DATA As Short = 99
Private Const DEFAULT_RESULT_SIZE As Short = 1024
Private Const SQL_DRIVER_STR As String ="DRIVER=SQL SERVER"
<dllimport("odbc32.dll")> Private Shared Function SQLAllocHandle(ByVal hType As Short, ByVal inputHandle As IntPtr, ByRef outputHandle As IntPtr) As Short
End Function
<dllimport("odbc32.dll")> Private Shared Function SQLSetEnvAttr(ByVal henv As IntPtr, ByVal attribute As Integer, ByVal valuePtr As IntPtr, ByVal strLength As Integer) As Short
End Function
<dllimport("odbc32.dll", charset:="CharSet.Ansi)"> Private Shared Function SQLBrowseConnect(ByVal hconn As IntPtr, ByVal inString As StringBuilder, ByVal inStringLength As Short, ByVal outString As StringBuilder, ByVal outStringLength As Short, ByRef outLengthNeeded As Short) As Short
End Function
<dllimport("odbc32.dll")> Private Shared Function SQLFreeHandle(ByVal hType As Short, ByVal handle As IntPtr) As Short
End Function
#End Region
'Lists SQL Server databases
'usage: comboBox1.Items.AddRange(SqlServersDatabases.Servers())
Public Shared Function Servers() As String()
Dim retval As String() = Nothing
Dim txt As String = String.Empty
Dim henv As IntPtr = IntPtr.Zero
Dim hconn As IntPtr = IntPtr.Zero
Dim inString As New StringBuilder(SQL_DRIVER_STR)
Dim outString As New StringBuilder(DEFAULT_RESULT_SIZE)
Dim inStringLength As Short = Fix(CShort(inString.Length))
Dim lenNeeded As Short = 0
Try
If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_ENV, henv, henv) Then
If SQL_SUCCESS = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, New System.IntPtr(SQL_OV_ODBC3), 0) Then
If SQL_SUCCESS = SQLAllocHandle(SQL_HANDLE_DBC, henv, hconn) Then
If SQL_NEED_DATA = SQLBrowseConnect(hconn, inString, inStringLength, outString, DEFAULT_RESULT_SIZE, lenNeeded) Then
If DEFAULT_RESULT_SIZE < lenNeeded Then
outString.Capacity = lenNeeded
If SQL_NEED_DATA <> SQLBrowseConnect(hconn, inString, inStringLength, outString, lenNeeded, lenNeeded) Then
Throw New ApplicationException("Unabled to aquire SQL Servers from ODBC driver.")
End If
End If
txt = outString.ToString()
Dim start As Integer = txt.IndexOf("{") + 1
Dim len As Integer = txt.IndexOf("}") - start
If start > 0 AndAlso len > 0 Then
txt = txt.Substring(start, len)
Else
txt = String.Empty
End If
End If
End If
End If
End If
Catch ex As Exception
txt = String.Empty
Throw ex
Finally
If Not hconn.Equals(IntPtr.Zero) Then
SQLFreeHandle(SQL_HANDLE_DBC, hconn)
End If
If Not henv.Equals(IntPtr.Zero) Then
SQLFreeHandle(SQL_HANDLE_ENV, hconn)
End If
End Try
If txt.Length > 0 Then
retval = txt.Split(",".ToCharArray())
End If
Return retval
End Function
Public Shared Function Databases(ByVal ConnectionString As String) As ArrayList
Dim retval As New ArrayList
Dim SqlConObject As SqlConnection
Dim SqldaObject As SqlDataAdapter
Dim SqlTblObject As DataTable
SqlConObject = New SqlConnection(ConnectionString)
SqldaObject = New SqlDataAdapter("SELECT name FROM sysDatabases", SqlConObject)
SqlTblObject = New DataTable
SqldaObject.Fill(SqlTblObject)
For i As Int16 = 0 To SqlTblObject.Rows.Count - 1
retval.Add(SqlTblObject.Rows(i).Item(0).ToString())
Next
SqlTblObject.Dispose()
SqldaObject.Dispose()
Return retval
End Function
End Class
SYAMLAL
|
|
|
|
|
Can anyone give a web site that tell about all connection string?
Thanks
................
|
|
|
|
|
|
Check these links:
1) http://connectionstrings.com/
2) http://www.carlprothman.net/Default.aspx?tabid=81
SYAMLAL
|
|
|
|