|
Hi,
After having created a new SQL server database in VB 2008 I am unable to perform a drag and drop for a datagrid of the table. When trying to drop the datagrid on a form it comes back with the following message:
An error occurred while performing the drop:
Illegal characters in path.
I recently followed the instruction videos of MSDN and was able to do it just fine. After a lenghty search for some references I needed I might have changed some setting in the process I am not sure. However I did reset all the environment settings to "factory" default and at witts end even uninstalled/installed VB2008express. I must say that at some point I had an error
on reset telling me it could not find "XML..."(can't remember the exact phrase anymore), but eventually it restored fine.
I do not have any code to show as it already happens just creating an .mdf/ making a table in a new project and trying to drop the datagrid onto the form. If someone could help me out or provide inspiration it would be appreciated.
All the best,
Robbert
|
|
|
|
|
Hello Everyone,
Before posting my requirement regarding adding elements to propertygrid dynamically and showing a dropdown checkedlistbox in propgrid, I want to tell that I did go thru loads of samples or articles (in this site) regarding propertygrid and its usage. I did find ways to add elements to propertygrid dynamically and examples whereby I found checkedlistbox in propgrid but I didnt find a combination of the two. I tried for a day or two to get them work together but failed.
I am using Visual Studio . NET 2008 (my dev language is VB.NET). I am relatively new to propertygrid control and thus not an expert at this. After using it for a while I figured that though it is not easy to add items to the grid dynamically. Looking here and there I came across a code in this site (codeproject.com) which is a class PropertyBag which helps in adding elements to propertygrid dynamically. This worked fine and I thought I was thru until something came up.
For a particular field I need a checkedlistbox style option. This checkedlist box should be dynamically added with elements and shows in propertygrid. This users can check/uncheck any item they want.
Thus to sum up I need a code that can enable me to add items to propertygrid at runtime and add items to checkedlistbox (also dynamically) which should be shown in propertygrid.
I have been struggling with this for few days and inspite of repeated tries I have been unsuccessful so far. A small working code will be appreciated.
I would be grateful if anyone can help me out.
Thanks,
Jack
|
|
|
|
|
How to set wallpaper with VB.NET 2005
|
|
|
|
|
Look into the SystemParametersInfo API. You can find an example here. Just a warning though - some image types can't be set as wallpapers, so you'll have to save a copy as a bitmap and use that
|
|
|
|
|
I'm trying to create a general error handler in a VBScript and I keep getting a syntax error in the following line:
On Error GoTo LogError
FYI, here is the error handler code:
LogError:
Log "ERROR", "VBScript runtime error = " & Err.number
Err.Clear()
Resume Next
I was wondering if VBScript actually does support the On Error GoTo construct. I haven't been able to find much while poking around the web with Google.
|
|
|
|
|
From what I remember it only supports On Error Resume Next.
But it's a few years since I used VBScript and things may have changed.
Regards
David R
|
|
|
|
|
This is true, only On Error Resume Next is available.
In January you said "Money in April" -
That was two years ago!
B. Python
|
|
|
|
|
Hello i don't know if this is the correct forum since i'm using vba excel.
My problem consists when trying too program my own opc client. I use a kepware simulation server too test my client.
In my program i use a treeview too show the layout of the server. If I click on the treeview it should show the items in that particular group. I can do that two times when i try too do that the third time i get an error that it can't find that particular item, but since it's in the treeview i know it excists.
this is how i connect too the server:
Set OPCMyserver = New OPCServer
OPCMyserver.Connect Selectedserver.Caption 'We try to connect to OPC server
Selectedname = Selectedserver.Caption
Set OPCMygroups = OPCMyserver.OPCGroups 'We load the OPC Groups
OPCMygroups.DefaultGroupDeadband = 0
OPCMygroups.DefaultGroupIsActive = True
OPCMygroups.DefaultGroupUpdateRate = 100
Set OPCMygroup = OPCMygroups.Add("Group_1") 'We add a group, the name is not important
Set OPCMyitems = OPCMygroup.OPCItems 'We load the OPC Items located in the OPC Group
Set OPCMyBrowser = OPCMyserver.CreateBrowser 'For the navigation in the OPC server
OPCMyBrowser.Showbranches
This is what shouls happen if you click on a node in the treeview
Private Sub OPCtree_NodeClick(ByVal SelectedNode As Node)
Dim itemnaam As String
Dim itemteller As Long
Dim anItem As OPCItem
Itemlist.ListItems.Clear
OPCMyBrowser.MoveToRoot
Set SelectedNode = OPCtree.SelectedItem
browseposition SelectedNode.Key
OPCMyBrowser.ShowLeafs
itemteller = OPCMyBrowser.count
For Each vName In OPCMyBrowser
itemnaam = "" + OPCMyBrowser.GetItemID(vName)
Itemlist.ListItems.Add , , itemnaam
Next vName
Dim I As Integer
For I = 1 To itemteller 'We add all the OPC Items of the ListView to the Collection of OPC Items
OPCItemIDs(1) = Itemlist.ListItems(I)
OPCMyitems.AddItems 1, OPCItemIDs, ClientHandles, ItemServerHandles, Errors
Next I
OPCMygroup.IsActive = Not OPCMygroup.IsActive 'Necessary to refresh data
OPCMygroup.IsSubscribed = Not OPCMygroup.IsSubscribed 'Necessary to refresh data
OPCMygroup.UpdateRate = Val(100) 'Use the refresh time
For I = 1 To Itemlist.ListItems.count 'For all the items in the ListView
For Each anItem In OPCMygroup.OPCItems 'For all OPC Items
anItem.Read OPCDevice 'Read the item, and the Item Id is the same than the current name in the ListView...
If anItem.ItemID = Itemlist.ListItems(I) Then
Itemlist.ListItems(I).SubItems(1) = anItem.Value '...get the Item Value...
Itemlist.ListItems(I).SubItems(2) = anItem.TimeStamp '...get the Item TimeStamp...
Itemlist.ListItems(I).SubItems(3) = anItem.Quality '...get the Item Quality
Exit For
End If
Next anItem
Next I
Set anItem = Nothing
OPCMyBrowser.MoveToRoot
End Sub
And this is how i browse for the correct position
Private Sub browseposition(ByVal Positie As String)
Dim I As Integer
Dim NormalPosition As String
Dim comparestring As String
Dim teller As Integer
Dim bfound As Boolean
OPCMyBrowser.MoveToRoot
NormalPosition = Positie
OPCMyBrowser.Showbranches
For Each vName In OPCMyBrowser
comparestring = "" + vName
teller = Len(comparestring)
If Left(NormalPosition, Len(comparestring)) = comparestring Then: bfound = True: Exit For
Next vName
If bfound Then
Do While (Len(NormalPosition)) > 0
OPCMyBrowser.MoveDown (comparestring)
comparestring = "" + Mid(NormalPosition, (Len(comparestring) + 2))
NormalPosition = comparestring
Loop
Else
MsgBox "No Match was Found for " & NormalPosition, vbInformation, "Match Failure"
End If
End Sub
I know it's rather a lot of code I added, but I didn't know what I should add and I can't find were it goes wrong. I only know that OPCMyBrowser.Movetoroot doesn't do it's job the third time.
I hope someone knows or sees what i'm doing wrong is.
greetings dadio25
|
|
|
|
|
Hello,
SO nobody knows what my problem appears too be or is it something else??
greetings dadio25
|
|
|
|
|
Hi All
I have a working code written in VFP http://www.foxite.com/archives/use-notepad-on-a-scx-0000129391.htm[^]
I tried to convert it to Vb.Net but I get stuck in error appearing whatever I do
Declare Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Declare Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nHwnd As Long
' run notepad
WinExec("notepad.exe", 1)
' find its hwnd
nHwnd = FindWindow(Nothing, "Untitled - Notepad") ' <-- Error
' Note you must supply the EXACT Caption of the window)
' force it inside our form
SetParent(nHwnd, Me.Handle.ToInt32)
' size it
Dim nLeft, nTop, nWidth, nHeight As Integer
nLeft = Me.Panel11.Left
nTop = Me.Panel11.Top
nWidth = Me.Panel11.Width
nHeight = Me.Panel11.Height
SetWindowPos(nHwnd, 1, nLeft, nTop, nWidth, nHeight, 64)
End Sub
Error Message : "Arithmetic operation resulted in an overflow"
I tried to add Panel, and command button and picture same result.
Could some one check it please,
And is there is better idea to show external window such as Excel or Word.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
First, scrap all of this. You don't need most of it. Your biggest problem is that you're using VB.NET and using VB6 code in it. You declared a bunch of stuff as Long, which under VB6, was a 32-bit signed integer and, under VB.NET, is a 64-bit signed integer. You cannot use the two types interchangably.
You can use this instead:
Private Declare Auto Function SetParent Lib "user32" (ByVal hwndChild As IntPtr, ByVal hwndParent As IntPtr) As IntPtr
...
' Launch a Notepad process and wait for it's window to be created.
Dim p As Process = Process.Start("Notepad.exe")
p.WaitForInputIdle()
' Then set it's parent window to a panel on our form.
SetParent(p.MainWindowHandle, Panel1.Handle)
|
|
|
|
|
|
Auto modifier
The Auto modifier instructs the runtime to convert the string based on the method name according to common language runtime rules (or alias name if specified).
|
|
|
|
|
No, it doesn't. When you create a declaration for a Win32 function, or some other external library function, some of these can come in two flavors, Ascii and Unicode (or Wide). For example, say you're digging around the MSDN documentation and find a function you need call SomeFunction. Well, you might see two version of if, one called SomeFunctionA and the other SomeFunctionW. Depending on which version of Windows you were running under, the W version of the function may not exist. So Auto will automcatically pick which function to bind to.
|
|
|
|
|
Dave Kreskowiak wrote: one called SomeFunctionA and the other SomeFunctionW
I have used API calls in VFP and vb6 for over than 5 years, I was able to customize the api to work as needed. I always copy the declaration from site or software.
Now, it is the first time I know why there is "A" or "W" at the end of the end of alias.
Many many thanks for this explanations.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Hi friends,
I have created find window, which finds out user entered values in the listview and selects that particular listview item. But the problem is, the selected item color turns gray(i.e Main window gets de-activated or no focus).If I activate or focus main window, then find window loses focus...So "Find Next" option can't be used..
So friends,how to tackle this issue.....?
It should work just like "Find window" in MS Word or excel...
Please guide me...
Thanks in advance
|
|
|
|
|
You're showing it modal (ShowDialog() ), whilst you just want to show it (Show() ). Don't forget to set TopMost to true
I are troll
|
|
|
|
|
Thank you, thank you...Eddy
Actually, i had set it to Show()itself,
But TopMost was false
Thanks a lot friend...
|
|
|
|
|
My pleasure
I are troll
|
|
|
|
|
I have a text file that has lines as follows:
thanks in advance
modified 28-Nov-12 4:45am.
|
|
|
|
|
Hi vijay,
is the name list is array or table column?
|
|
|
|
|
Does this compile?
The line i = name.Substring(0, m) implies i is a string.
But in the sw.WriteLine(), name.Substring(0, i) implies i is an integer.
Are the lines in the text file indented by two spaces as in your example?
If so you could just drop lines that start with two spaces (assuming you don't trim them as you read them.)
Regards
David R
|
|
|
|
|
I am not a Programmer in fact i am amedical doctor a pediatrician by profession and do little bits in vb 6 out of my interest
Currently i wanted to create a math Solver in which the user input would as one would write on paper
My PROBLEM
here is the code now what i needed was to
1 get the same as typed in the rich text box into a textbox wich i want use for math parser
2.In the Textbox i wanted to have a caret sign("^")In the position i use the Up Arrow key in the Rich text box
<b>Need help Urgently </b>
Private Sub rtb1_KeyUp(KeyCode As Integer, Shift As Integer)
Me.KeyPreview = True
Dim SupEnt As Integer
Dim temp As Integer
SupEnt = rtb1.SelFontSize
temp = rtb1.SelCharOffset
Dim SelectionStart As String
Dim SelectionEnd As String
Dim selectedExp As String
Select Case KeyCode
Case vbKeyUp
rtb1.SelFontSize = SupEnt / 3 * 2
rtb1.SelCharOffset = temp + 100
rtb1.SelColor = vbRed
KeyCode = 0
Case vbKeyDown
rtb1.SelFontSize = SupEnt / 3 * 2
rtb1.SelCharOffset = temp - 100
rtb1.SelColor = vbGreen
rtb1.SelBold = True
KeyCode = 0
Case vbKeyLeft
'
Case vbKeyRight
rtb1.SelFontSize = 14
rtb1.SelCharOffset = 0
rtb1.SelColor = vbBlue
KeyCode = vbSpace
sText = rtb1.Text
sRight155 = Right$(sText, 1)
LastChar = Right$(sText, 1)
'
Clipboard.SetText rtb1.Text
myString = Clipboard.GetText
Text1.Text = Replace$(myString, LastChar, "^" + LastChar, 1, 1, vbTextCompare)
Clipboard.Clear
Case vbKeyReturn
End Select
End Sub
|
|
|
|
|
Hi .... everyone
I have a test code,I want to jump the check and all check is pass
(IsTrialPeriod,IsRegExpired,IsDoOncePeriod_CheckReg.... ,etc ....these check),so who can help me to modify the return value to pass program check , I don't want this code to make my future program to show register or any alert !
p.s. these is only test code for my homework , I just want to know how to jump the check fuction .
http://rapidshare.com/files/215636655/Program.txt.html[^]
garnett
|
|
|
|
|
You just want to cripple this check, kinda like this?
Private Shared Function IsRegExpired() As Boolean
Return False
End Function
These kinds of tests are usually built in such a way that bypassing them ranges from hard to impossible.
I are troll
|
|
|
|
|