|
DropDownMode i believe, you want it as a dropdownlist so that they cannot type.
|
|
|
|
|
Hi!
I would like know about if exist a method for detect the connection/disconnection of LAN network using Windows's API in vb, i found in anothers internet sites but i not found nothing as help, i sorry but, can you help me in this problem?, thanks for your help.
|
|
|
|
|
Check the My.Computer.Network.IsAvailable property.
|
|
|
|
|
Hello every one,
I am making a VB 2005 application in express edition, to let the user do a free hand drawing.
I want to hide the mouse pointer / courser over the picture box.. Is it possible...if yes plz let me know..
Regards
Nishkarsh
|
|
|
|
|
If you want to allow user to do free drawing in that case instead of hiding mouse cursor you should use a cursor like Cross, this can be done by simply setting cursor property of the picture box-
PictureBox1.Cursor = Cursors.Cross
However if you do not want to see any cursor when mouse comes over picture box control, you will need to use API function.
Following code should give you the desired result-
-------------------------Code Start------------------------------------
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Dim Show As Boolean
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
Show = False
ShowCursor(Show)
End Sub
Private Sub PictureBox1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave
Show = True
ShowCursor(Show)
End Sub
----------------------------Code End------------------------------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Use Cursor.Hide() and Cursor.Show() in MouseEnter and MouseLeave events of the picture respectively.
|
|
|
|
|
Hi
Is there any direct way to get the number of records in random access files except by calculating the length of file and then dividing it by the length of each record.
(Visual Studio 2003)
Thanks
reman
|
|
|
|
|
You have two choices. You can either "do the math", or you can read the entire file record-by-record and count them. There's no other way to do it.
|
|
|
|
|
I am relatively new to vb.net.
I have a windows form with a command button followed by 3 radion buttons (ie GoBtn, ByDate, ByRef, None). None is marked checked at design time.
At run time, if I hit Go then the ByDate radio button gets turned on. Is this 'normal'? I don't understand this behaviour.
Thanks for your help!
QuickBooks Programming, Add-ons, Services
www.AaaTeX.com
|
|
|
|
|
It depends on the order that the radio buttons were created in the designed generated code.
To "fix" this, just set the default button in your form's Load event, or some other initialization code that sets up a known state.
|
|
|
|
|
Hi
I am not very familiar with shell programming. I am using SHChangeNotifyRegister to be notified of file system changes. Everything works fine except with the SHCNE_CREATE notification when a new file is created.
Then, in this case only, the pidl returned by the function will provide the new file's display name, but SHGetPathFromIDList will not provide the path. I can only guess that in the case of a new file being created, the function only sends a pidl which is relative to the parent folder.
I wondered if anyone knew how I can get from the pidl provided by SHGetPathFromIDList to a fully qualified pidl so that I can retrieve the new file's system path.?
Strangely,when a file is deleted the function does provide a fully qalified pidl from which the path may be obtained.
Public Sub NotificationReceipt(wParam As Long, lParam As Long)
Dim shns As SHNOTIFYSTRUCT
Dim sDisplayname As String
Dim NewName As String
Dim OldName As String
Dim FileData As FILE_DATA
On Error Resume Next
'Fill the SHNOTIFYSTRUCT from its pointer.
CopyMemory shns, ByVal wParam, Len(shns)
If shns.dwItem1 Then
sDisplayname = GetDisplayNameFromPIDL(shns.dwItem1) 'works in all cases
If Len(sDisplayname) Then
OldName = GetPathFromPIDL(shns.dwItem1) 'fails only when lParam SHCNE_CREATE
........................
Else
End If
End If
If shns.dwItem2 Then
sDisplayname = GetDisplayNameFromPIDL(shns.dwItem2)
NewName = GetPathFromPIDL(shns.dwItem2)
If Len(sDisplayname) Then
......................
Else
End If
End If
..................
Any help would be greatly appreciated.
Bertram
|
|
|
|
|
Hello
Transferring settings Pagesetup to printpreview
tks
Fulvio
|
|
|
|
|
Hi..
This is a two step process..
take a print document and assign it the printerSetting and page settings at the place where you call page setup dialog
If PageSetupDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
PrintDocument1.PrinterSettings = PageSetupDialog1.PrinterSettings
PrintDocument1.DefaultPageSettings = PageSetupDialog1.PageSettings
end if
after that use the same page for preview
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.ShowDialog()
this will automatically reflect all the setting in preview window
Good luck
|
|
|
|
|
|
Hello friends i want to copy a fiel in vb6
if u have any idea about it.
i tried filecopy(sourcefile,destination)
but it give permission denied runtime erro 70.
|
|
|
|
|
do you have the permission to copy that file?
If not then its kinda obvious
else i would say try another file
"All your base are belong to us..."
Mr. Cats (2110 A.D.)
|
|
|
|
|
Yes i have the permission
|
|
|
|
|
Then that file is probably either read-only or open by another process.
|
|
|
|
|
Hello guys.I have a problem updating my MS Access from datagrid.
The update button is ther already so I dont need it. I jus need the coding.
Here is what Ive got and I cant geddit correct.Thanx in advance guys.
Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView1.RowUpdated
Dim cm As New OleDbCommand
Dim con As New OleDbConnection
Dim str1 As String = "Provider = Microsoft.Jet.oledb.4.0; Data source =C:\Documents and Settings\Kagisho.Mashiloane.ALFRGIS\My Documents\Visual Studio 2005\Projects\Search AL\TelephoneList.mdb"
Dim str2 As String
con = New OleDbConnection(str1)
con.Open()
str2 = "select * From Extensions"
cm = New OleDbCommand(str2, con)
Dim updateSQL As String = "UPDATE Extension SET Name = @Name, " & "Surname = @Surname, " & "Xtension = @Xtension"
cm.Parameters.Clear()
cm.Parameters.Add("@Name", Name)
cm.Parameters.Add("@Surname", Surname)
cm.Parameters.Add("@Xtension", Xtension)
cm.ExecuteNonQuery()
'Next
lblUpdatemessage.Text = "Update Successfull"
kagiso
|
|
|
|
|
This is just a comment cause a don’t really like doing db stuff in code.
You might wana review your approach to this problem. Placing the connection code inside the row update event is not the best idea.
You should consider using datasets, table adapters etc. to simplify this process.
For example:
1. Form init
2. grid loaded by querying a table adapter in the dataset
3. returned result is passed to .Datasource of the grid
4. grid is refreshed
5a. row changes on the grid are auto reflected on underlying data in the dataset table (not db)
5b. row changes remain in memory
6. once you actually need to write the whole thing to the db use the table adapter's .Update method on the dataset
7. dispose of the form or whatever
Obvious benefits:
1. overhead of connecting to the db every time a row is changed is eliminated
2. simpler implementation allows for greater control and easier maintenance
3. dataset classes can be extended to handle everything themselves with minimal interference
If you have dataset specific questions post them here, members will definitely help you out
"All your base are belong to us..."
Mr. Cats (2110 A.D.)
|
|
|
|
|
|
Good Morning Kagiso,
What the guy is saying is true,i see that you are getting somewhere. you have to create a dataset to Display or save the data in the datagrid, out it this, you dont save the data in the datagrid, but you save the data in the dataset. Create a dataset and one adapter, and fill the dataset and if you want to update, in your Update command of your adapter, use your update commmnd. i have an article that can show you how to do it. Am using a datagrid to save and display the data.its in vb.net, you will just have to convert. and dont forget to vote.
http://www.codeproject.com/useritems/N-Tier_Application_VB.asp[^]
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
i am creating a control datagridview at runtime . and entering column and row names .
I am saving the details of no of columns and rows ,font,borderstyle and normal details in a datatable .
item(col,row).value means i am getting the cell information,
But i am not getting the columns and rows headers here bcoz it doesnot take
-1 . By Which means i can store all these information ?? in a datatable and assing it to back ?
For1206
|
|
|
|
|
You'd have to build some kind of object to store this data in, be it a datatable, or a custom serializable class designed to hold this data. Then you just serialize the instance of the class out to an XML file.
|
|
|
|
|
Hi
I am using inputbox function to set or get the column names and row names of datagridview ,
1) when i call that function it shows the text of particular column or row ,If i make changes or not , then if i click OK it is showing the new name or or old name for datagridview col or row header .
2) When i click Cancel,Then the problem arises ,If there is string in the textbox of inputbox() also it is returning the length of string as 0,Which is setting the column Text or Row text as "" . So How can i maintain the text when the user presses cancel
Any Help in this ....
DVS
|
|
|
|