|
Try this ...
' Maximize the Access window:
oAccess.RunCommand(Command:=Access.AcCommand.acCmdAppMaximize)
I got it from the following article:
How To Automate Microsoft Access From Visual Basic .NET
http://support.microsoft.com/kb/317113[^]
|
|
|
|
|
Thanks mate
it works with a slight changed for VB6 ie
oAce.RunCommand acCmdAppMaximize
Cheers!
|
|
|
|
|
Hi Everybody,
My question is regarding using the LZO.NET library in a VB.NET project.
The code below is a small class "tester" which decompresses a Byte().
The problem is that the function is returning only ""
What is it that I could be doing wrong?
Abhay
===========================================================================================
Imports System.Net.Sockets
Imports System.Text
Imports System.IO
Imports System.Net
Imports System.Threading
Public Class Tester
'Here bteReceiveData is a Array of Bytes that are compressed using LZO.
Public Function Decompress(bteReceiveData() As byte) As String
oLzo = New Simplicit.Net.Lzo.LZOCompressor()
Dim cDecompressed As String
cDecompressed = Encoding.Unicode.GetString(oLzo.Decompress(bteReceived))
return cDecompressed
End Function
End Class
===========================================================================================
Abhay
StanSoft
|
|
|
|
|
Your best bet would be to find a discussion forum that uses that library, or contact the people who wrote it.
|
|
|
|
|
I have a application which was composed by VB 6.0 and SQL server. It is running well with all Desktop Laptops XP profession.
But now when I have a new laptop downgraded from Vista to XP, then the application does not work.
The message is : "Error 419: Permission to use object denied"
Could you please show me how to solve this problem.
Highly appreciated for your support.
Chau Ngoc Vo, Software develope
|
|
|
|
|
What you do depends on the object you're using. There is no "one fix for all problems" for this.
|
|
|
|
|
Hi,
I have create on button in Flash.
When i click that button. It will invoke one of my forms or let's say bring me to form2.vb .
Can any one guide me how to do this?
Thanks in advance.
|
|
|
|
|
Last I checked, you can't. The button clicks in the Flash "document" do not propagate up to your form. VB.NET will never know the user clicked the button.
|
|
|
|
|
I have a simple windows form with a textbox and a button. Click the button and you get a msgbox that I am using for a hyperlink. The results are how I need them to look but I can not copy it to paste into a browser. In a perfect world, I would like to have the click generate a link instead of a msgbox but I'm such a beginner I dont expect to be able to do this easily. Any help would be appreciated! Here is the click event for the button:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("http://webmail.sale.com/loansales/search.aspx?searchcommand={LF:Name=""*" & TextBox1.Text & "*"",%20Type=""F""}")
End Sub
Is there a property that can be set on a msgbox that allows the text to be copied?
|
|
|
|
|
You can always place the information in the clipboard where the user can ctrlV it into the browser.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
if you mean just to ctrl+c, that doesnt work because it gets more than just the msgbox, it gets the title and everything else. IF there is a way to copy the results straight to the clipboard, that would work, I just dont really know how.
|
|
|
|
|
Hi,
you can programatically store the string on the clipboard using Clipboard.SetText; however that is not considered good practice, the user is in charge of the clipboard, so normally a CTRL/C should preceed any change on the clipboard.
Assuming you have a Form, you could use a Label, set the string to its Text; after that it can be copied by selecting and typing CTRL/C.
|
|
|
|
|
I know how to set the string to its text, but I also need to add dynamic text to the string that an end user will type into a text box, so what I am actually after, is to end up with a string that would look like:
http://www.website.main & (enter whatever the end user needs here) & search.com. In other words, I have the beginning of the link, and the end of the link, but the end user will be providing the middle part of the URL.
I'm way new to this, so any and all of the suggestions have been a great help and a great learning tool. Thanks
|
|
|
|
|
What about not using a message box, and simply creating your own modal/popup form that is the size and shape of a message box, hence allowing you to use a textbox to display the text to allow the user to select it, or even a button that says "copy link" or whatever... ???
|
|
|
|
|
Thats a good answer, thanks! Now all I have to do is learn how to do it.
|
|
|
|
|
I'm writing a solitaire game and trying to drag and drop card images from an array of images to on top of another array of images on a form. I'm stuck on trying to get the images dropped and MsgBoxes to work...I have them for test purposes. Here is some of my code. Note: I tried to use .net, but since I'm such a newbie, I thought I'd stay with VB6 for this. Not a school assignment. A birthday present to someone. sorry for bad format; just testing right now.
Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Dim HeartsIndex As Integer
Dim NewIndex As Integer
Dim Button As Integer
HeartsIndex = 0
Index = 0
For HeartsIndex = 1 To 12 - 1
For Index = 1 To 12 - 1
Hearts(HeartsIndex).Picture = Image1(Index).Picture
If Button = vbLeftButton Then
If TypeOf Source Is Image Then
Hearts(HeartsIndex).Picture = Source.Picture
End If
End If
Next
Next
NewIndex = 0
For NewIndex = 0 To 12 - 1
If Hearts(NewIndex).Picture <> Image1(NewIndex).Picture Then
Image1(NewIndex).Drag vbCancel
MsgBox ("This card does not belong here")
Exit Sub
Else
Image1(Index).Drag vbEndDrag
MsgBox ("You're right!")
Exit Sub
End If
Next
End Sub
|
|
|
|
|
Yep 4 hours later and still no response - get the hint, VB6 is dead and no longer supported, the people who usually answer forum questions are all using .net and have been for years, any help from them will be based on them dragging old info out of the deep past and is of little interest to them!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Some comments on the code.
1 The For NewIndex = 0 To 12 - 1 loop will only be done with NewIndex = 0. It must take either the If or Else branch, both of which exit the sub.
2 Why have 12-1 as end value for loops? Why not just 11?
3 In the For NewIndex = 0 To 12 - 1 Else branch you have Image1(Index).Drag vbEndDrag . Should this be Image1(NewIndex).Drag vbEndDrag ?
4 You don't need to initialise the index variables to 0 since they are set by the For statements.
5 Why is Index a parameter? Whatever value is sent in is ignored since you use it to control the inner loop. So it gets set to 1 and ends up at 12 irrespective of what was supplied. So when the sub returns, whatever variable was supplied will have value 12 (IIRC VB6 defaults to pass ByRef so it changes values in calling code). Is this what you want to do?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Thank you David for your suggestions and expertise. You are really thoughtful, even if I'm using VB6. I tried to use .NET, but it actually takes much more expertise and code than I have, at this time...I'm learning it though....so that is why I'm using VB6 for this.
Anyhow, Index was used as a parameter because that is what I saw in several tutorials on drag/drop operations. I see your point though. I'll try again and see what I come up with. Thanks again!
|
|
|
|
|
|
|
I did some work on this, but what happens at run time is:
The message displayed is "This card does not belong here" irregardless of whatever image1 card I place drag and drop over the hearts card. I can drag the matching card, or another one to the very same slot and that message is displayed. It's like the code never gets past the <> line.
At run time, after I drop the image1 card over the hearts card, then all the cards in the image1(0) slot automatically drop on the same position hearts cards. Any ideas on how I can wrestle with this would be appreciated.
Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Dim HeartsIndex As Integer
Dim NewIndex As Integer
Dim Button As Integer
For HeartsIndex = 0 To 12
For Index = 0 To 12
Hearts(HeartsIndex).Picture = Image1(Index).Picture
If Button = vbLeftButton Then
If TypeOf Source Is Image Then
Hearts(HeartsIndex).Picture = Source.Picture
End If
End If
Next
Next
For NewIndex = 0 To 12
If Source.Picture <> Image1(NewIndex).Picture Then
Image1(NewIndex).Drag vbCancel
MsgBox ("This card does not belong here")
Exit Sub
Else
Image1(NewIndex).Drag vbEndDrag
MsgBox ("You're right!")
Exit Sub
End If
Next
|
|
|
|
|
Not sure what is supposed to be happening here so it's difficult to advise what to do. It depends on what the screen looks like e.g. what is the Hearts control, what is the Source control?
However, one obvious point is that If Button = vbLeftButton Then will never be true. And I don't think you need it. The DragDrop event is triggered when the source object is released over the target (i.e. the Hearts control). You have no way of knowing which mouse button is involved.
Another thought is that you might want to move the Source (assuming it can be dropped on target i.e. is a heart) rather than setting Hearts(x).Picture = Source.Picture.
I just fired up my old VB6 box to check help on drag-and-drop. Not exactly clear is it?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Thanks David! I tried again but I'm thinking I'm getting more confused though....
I read through a tutorial that the target card, the one that's supposed to be dropped on, is the source card, thus I set the hearts to the source card, just like they coded.
Then image1 array of cards is supposed to equal the hearts array...if the card that is used to drop, image1, once chosen, does not equal the exact heart card to be dropped on, then the message would be "Your card does not belong here." Else, it does belong there.
I hope I'm not being even more confused when writing this, but here is what I've tried. What is happening at run time is like I find the ace card, image1(12) and try to drop it on hearts(12), it says "Your card does not belong here" then all the #12 position card in the location of the 12th card on the image1 card side, all take the spaces of hearts(1 through 12). It's weird. If you send me your email addy, I can send you a screen shot. Pardon the formatting.
Here's what I have....
Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Dim HeartsIndex As Integer
Dim NewIndex As Integer
For HeartsIndex = 0 To 12
For Index = 0 To 12
If TypeOf Source Is Image Then
Hearts(HeartsIndex).Picture = Source.Picture
Hearts(HeartsIndex).Picture = Image1(Index).Picture
End If
Next
Next
For NewIndex = 0 To 12
If Image1(NewIndex).Picture <> Hearts(NewIndex).Picture Then
Image1(NewIndex).Drag vbCancel
MsgBox ("This card does not belong here")
Exit Sub
Else
Image1(NewIndex).Drag vbEndDrag
MsgBox ("You're right!")
Exit Sub
End If
Next
End Sub
|
|
|
|
|
Sounds a bit of a strange tutorial, how can source and target be the same?
As I said I'm not sure what the GUI is like so here's my take on what you might need to do.
Assuming you have four piles (one each for Hearts, Spades, Clubs and Diamonds) each being a control array of images. The aim being to complete each pile by placing cards on it in order.
You also have a deck of cards and possibly one or more heaps of cards (it depends on the version of solitaire you want to play).
Simplifying, the rules are that the top card of the deck is turned face up. It can then be placed on one of the piles or one of the heaps. A card can be moved from a heap to the appropriate pile provided it is same suit and 1 higher in value than top of pile (if the pile is empty it must be the Ace).
In terms of code the source will be the selected card on a heap, or the top of deck; the target will be one of the piles.
So the piles must react to the DragDrop event (as in your Hearts_DragDrop).
The question is what must it do in this event? The answer depends on the rules of the game and your GUI design. However, it should only be dropping one card onto the top of the pile. Your first loops are trying to drop all the image1().Pictures onto all the Hearts().Pictures. Looking at the code it has the same effect as this bit of code (not what I think was intended):
For HeartsIndex = 0 To 12
If TypeOf Source Is Image Then
Hearts(HeartsIndex).Picture = Image1(12).Picture
End If
Next
I.e. the effect is to set all the Hearts().Pictures to image1(12).Picture.
It might be better to continue this off-forum, if so, you can mail me as riced with domain david-rice dot demon dot co dot uk . (obviously in proper email address format!)
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|