|
Well the subject says it all.
I believe that every object has a hWnd and using this hWnd you can color the background of a treeview or do all sorts of thing. Do you know where i can find an article about this?
Thnx,
Grtz,
Guus
|
|
|
|
|
gpa2000 wrote:
I believe that every object has a hWnd
Not true. every Window has a Window Handle. Individual controls are also windows and have a window handle. But not every element you see on the screen or every object in memory has a Window Handle.
gpa2000 wrote:
using this hWnd you can color the background of a treeview or do all sorts of thing
Uhhh...not exactly. The hWnd is the identifier for a Window that you can use to talk to the Window or other functions that take a hWnd as an input parameter. The Win32 API is FULL of funtions that use hWnd and not just for modifiying control properties. There isn't any one article that covers all the uses for Window Handles, but you can start here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows.asp[^]
RageInTheMachine9532
|
|
|
|
|
hello
i wish to know the coding
for the button
that perform opening either Internet Explore or Netscape
to a web address
i hope it wont be a trouble
thank you
Gary
|
|
|
|
|
In VB:
'<br />
' Procedure voor het opstarten van de default browser met een URL<br />
'<br />
' Zie Q224816, Q174156 voor meer informatie<br />
'<br />
Public Sub StartDefaultBrowser(ByVal strUrl As String)<br />
Dim lngReturnValue As Long<br />
<br />
lngReturnValue = ShellExecute(0, _<br />
"open", _<br />
strUrl, _<br />
0, _<br />
0, _<br />
SW_SHOWNORMAL)<br />
' Returnvalue <= 32 means error<br />
If (lngReturnValue <= 32) Then<br />
Err.Raise ERR_WARNING, FormatErrSource(MODULENAME, "CheckFields"), "Can't start default internet browser (" & CStr(lngReturnValue) & ")"<br />
End If<br />
<br />
End Sub
Grtz,
Guus
|
|
|
|
|
|
Can someone tell me how to print the text at the center of the paper?
i am using a receipt print with a maximum of 40 characters per line
Proper Planning is way to success
|
|
|
|
|
Since you know the width of the printer you pad the beginning of the string with spaces. Take the length of the line you want to print away from the width of the printer, then divide that difference by 2 to get the number of spaces to add on both sides of the test you want to print, but only add it to the beginning of the text:
Dim sText As String = "Text to print Centered"
Dim iPad As Integer
iPad = ( 40 - sText.Length ) / 2
sText = New String( Chr(32), iPad ) & sText
RageInTheMachine9532
|
|
|
|
|
New string is an unexperted identified. so how??
Proper Planning is way to success
|
|
|
|
|
Are you using VB6 or VB.NET?
The code sample works as advertised on VB.NET.
The equivelent code in VB6 would be this:
Dim sText As String
Dim iPad As Long
sText = "Text to print Centered"
iPad = ( 40 - Len(sText) ) / 2
sText = String$( iPad, 32 ) & sText
RageInTheMachine9532
|
|
|
|
|
Writing code using VB.net (aspx file)~ script assignment statement: set UserData = request.form("UserData") yields a compile error ~ 'Let' and 'Set' assignment statements no longer supported. Is there a substitute assignment statement that will work instead of 'Set' ?
Many thanks!
Reed Eichner
reichner@satx.rr.com
|
|
|
|
|
Yeah:
Dim UserData As String
UserData = Request.Form.Item("UserData")
RageInTheMachine9532
|
|
|
|
|
Hello,
Is there a way to create an entire Access database (I know what tables and the relationships needed between the tables) using VB code? For instance, if a user clicked on a "Create Plan" icon, the following database would be created in the back end:
Database: Census
Tables:
Client
Plan
Employees
Contacts
If you know of references you could direct me to in order to learn more about this, it would be greatly appreciated.
Thanks so much!
Vi
|
|
|
|
|
There are ways to do this. Are you using VB6 or .NET?
|
|
|
|
|
Hi Mike,
I forgot to mention that I'm using VB.net . I'm a new user and have just gone through my first book Visual Basic.Net Step by Step. I'm trying to create a utility for use at work and have no idea where to begin. Any ideas / help would be greatly appreciated.
Thanks so much!
Vi
|
|
|
|
|
Hi Vi. You know, most beginners start with "Hello World" instead of "Create Access Database from Scratch"
One way to accomplish what you're describing is through the ADOX library. Here's a link to MSDN documentation introducing ADOX:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/admscadoxfundamentals.asp[^]
In a nutshell, the ADOX Catalog object's Create() method will let you create the .mdb file. Then you can use a standard ADO.NET OleDbConnection object to connect to the new database file, and an ADO.NET OleDbCommand object to execute sql statements against the connection. Using OleDbCommand 's ExecuteNonQuery() method will let you issue statements like "Create Table xxx ..." to create your tables. Alternatively, you could use ADOX's Table object to accomplish the same task.
ADOX is a COM library, not a .NET library, meaning that you have to use Interop techniques to use the ADOX objects in your .NET code. This isn't difficult, and there are many articles available on the subject of COM Interop. This article shows an example of using Visual Studio to make the proper references to the COM ADOX library:
http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/32/pid/796/fid/3888[^]
This article (right here on CodeProject) goes more in depth into the concept of Interop. Its fairly long, but toward the bottom are ADOX examples that are directly relevant to the task you're working on -
http://codeproject.com/books/186100558x_16.asp[^]
I hope this gives you something you can work with.
--mike
|
|
|
|
|
Excellent! Thank you so much Mike for taking the time to post this. I will most definitely do some digging.
|
|
|
|
|
Hello, My name is jason.
I am trying to write a program that will track the times and the dates that an employee has worked. I know how to hard code it but, it is the gui that i am having a problem with. Here are my main problems. When the program starts i would like a password screen to appear, where the user or the manager enters her/his password. This part I have accomplished, the password screen. I have placed 9 buttons, when the user clicks on the buttons i record or add to a string, and when the user hits okay, i read the finished string and see if there is an employee. My problem is this, I need to have to different windows, one for a manager, and another for a employee. Meaning, if a manager comes along, types his password, i would like a window appearing where he has the option of looking how has clocked in, how many employees are currently working, total hours ans so forth. When a employee comes along, enters his/her password, i would like them to see when they have started, or if they have not punched in, a punch in button, or a punch out button and so forth..
If anyone could help me out, or give me advice on how to create those two different windows and how to interact or how to dynamilcly pop up those two windows depending on who is entering a password, i would be sooooo happy.
you can email me at jdogan@hotmail.com
none
|
|
|
|
|
Hi! Guys,
I am new to .NET Technologies. I am creating a small application and want to include a facility for Backup.
The problem is, how to create a wizard which will guide the user for creating backup of database, just like Windows. Like, it will ask for path to store backup, other filteration criteria for data to take backup etc.
One approach can be to create a frame for each step and display them as per the user's choice (Back / Next).
Is this approach proper? What are the other possible ways?
Please, send in your suggestions and / or comments regarding this problem.
Thanking you,
Ritesh.
|
|
|
|
|
I was wondering how you would write a file to disk. In 6.0 you used the open command. I was just wanted to know the process of writing to disk.
|
|
|
|
|
What kind of file were you looking at writing? There are a few methods available.
Text files are the easiest and can be done using the FileStream classes:
Dim sr As StreamWriter = File.CreateText(FILE_NAME)
sr.WriteLine("This is my file.")
sr.Close()
Binary files are a little more complicated but are still be based on FileStream classes:
Dim fs As New FileStream(FILE_NAME, FileMode.CreateNew)
' Create the writer for data.
Dim w As New BinaryWriter(fs)
' Write data.
Dim i As Integer
For i = 0 To 10
w.Write(CInt(i))
Next i
w.Close()
fs.Close()
' Create the reader for data.
fs = New FileStream(FILE_NAME, FileMode.Open, FileAccess.Read)
Dim r As New BinaryReader(fs)
' Read data from Test.data.
For i = 0 To 10
Console.WriteLine(r.ReadInt32())
Next i
w.Close()
For more information, lookup 'FileStream Class' in the VS Help Index, or on MSDN here[^].
RageInTheMachine9532
|
|
|
|
|
In visual basic, is there a way to change the tab that is selected before the event for pressing a mouse button is fired? Right now, I want the user to be able to right click on the tab and bring up a context menu for the tab that they click on, but the context menu event fires first, so it is the context menu when the old tab is selected. Anyone know how to change focus first?
thanks
s
|
|
|
|
|
www.DNNCS.com for sale
please email me at kuponutcom@hotmail.com if you're interested
(it stands for...... DotNetNuke CSharp .com)
thanks
|
|
|
|
|
I want to use VB.Net to talk with mobile phone like ( Nokia,Siemen) as following:
-SMS Function (Send , recieve SMS)
-Read Netmonitor from mobile phone
I have got some problem with them.
I need help!
you can send source code or other information to My Email :012272740@mobitel.com.kh
Thanks.
|
|
|
|
|
I have a Datagrid that is bound to a typed dataset that is loaded from a SQL database.
While typing data in a new row on grid the other column cell values all contain the value "(null)".I cannot present something like this to a client. Is there any way of formatting the new row to present empty or default values ?
|
|
|
|
|
Jazeker:
My solution to this problem is to write a function ReplNull which returns a default when a value is Null:
Public Function ReplNull(ByVal varSource As Variant, _<br />
ByVal varReplaceBy As Variant) As Variant<br />
<br />
If IsNull(varSource) Then<br />
ReplNull = varReplaceBy<br />
Else<br />
ReplNull = varSource<br />
End If<br />
<br />
End Function
Or use the CASE WHEN clause in your SQL statement to replace Nulls by your default.
grtz,
Guus
|
|
|
|