|
Hi,
I am developing an app in vb.net that relies on the presence of another application running at the time. Can anyone tell me how to detect if the other application is currently loaded,
Regards
Dundoan
|
|
|
|
|
Do a search on GetObject() from the Visual Studio help system. It will provide the information you need. In summary, an extract from the help is shown below. (Note this example is in VB 6.0 - you'll need to modify slightly for VB.NET.)
' Test to see if there is a copy of Microsoft Excel already running.
On Error Resume Next ' Defer error trapping.
' Getobject function called without the first argument returns a
' reference to an instance of the application.
' If the application is not running, an error occurs.
MyXL = GetObject(, "Excel.Application")
If Err().Number <> 0 Then ExcelWasNotRunning = True
Err().Clear() ' Clear Err object in case error occurred.
...Steve
|
|
|
|
|
how to connect visual basic 6.0 to sql sever 2000.i have both the sql sever and vb 6.0 both installed in my pc.i am doing a project which requires me to connect vb to sql sever and to the programming in vb using sql sever as a database.
so can anyone please help me to connect vb to sql sever please.
email: goundar_j@yahoo.com
|
|
|
|
|
Hi,
anyone know anyway of converting geographical coordinates to screen coordinates?
I have a world map, and I want to plot icons on it, but I first need to transform my longitude and latitude values to x,y values)
|
|
|
|
|
There is any way to show a tooltip within the need of stop the mouse over a control?
For example show the tooltip when a timer counts to 5 seconds...
Thanks
|
|
|
|
|
Yes. Use the Tooltip control.
Add it to the form.
Then to add the tooltip:
myTooltip.SetToolTip(MyControl,"This is the text")
where myTooltip is the tooltip you created above and myControl the one you want the message associated with. If you look in the doc you can also specify the timing.
|
|
|
|
|
Yes, I know. But this tooltip will show when user stops the cursor over the control.
I want to show it with no action from the user.
Thanks anyway
|
|
|
|
|
You really have to read the documentation for the Tooltip[^] class. There are properties that let you control how fast the Tooltip shows up (by default, a half second), how long it stays displayed, and others.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
But that I want is to show the tooltip without the cursor.
Maybe I'm not explaining well...
I'm reading the link you share and in one of the first lines says
"The ToolTip class allows you to provide help to users when they place the mouse cursor over a control."
I think that this explanation answer my question. It's not posible to show the tooltip if the cursor don't moves over him.
|
|
|
|
|
ecentinela wrote:
It's not posible to show the tooltip if the cursor don't moves over him.
Nope. That's not the defined behavior of the ToolTip component. If you want Tooltips showing over all of your controls without the mouse being anywhere near them, you'll have to draw the ToolTips yourself. This is not a good idea though. You'll end up cluttering your user interface with all kinds of information that the user doesn't need when they become familiar with your app.
Think of if this way. Have you ever seen a Windows application that does this? Why not? Because the user interface was (hopefully!) well thought out to begin with. It should be intuitive to use without all the help showing on every control.
If you want to show a little help with whatever control the mouse passes over, other applications tend to put a short message in the status bar of the application window describing the functionality of that control.
The Windows user experience should be consistant acrossed all, or most, of the applications the user runs. If you deviate from the accepted, and more importantly defined norm's in the Windows User Interface Design Guide, you'll end up confusing the user more than you think you're helping them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am in the process of moving my pages from asp to aspx and I ran into a snag. I have an order form that I use to place items into a Yahoo shopping cart. To do this, I have 2 forms on the old asp page each having an item. When I moved this code over to the aspx page, I found that the first form just posts back to the aspx page but the second works fine. More over, when I put a blank form before the two original forms they both work fine. It seems only the first form does not work. This is a workaround for the problem but I would like to know what is going on. Please let me know!
Regards:
For example:
<body>
<form
id="Form2"
method="post"
runat="server"
>
--- This Form Posts Back to the aspx page
<form
method=post
Id=frm02
Action="http://order.store.yahoo.com/cgi-bin/wg-order?mysite"
>
<input
Name=vwcatalog
Type="hidden"
Value=mysite
>
<input
Name=vwitem
Type="hidden"
Value=item1
>
<input
Name=vwquantity
Type="hidden"
Value=0
>
<input
Class="submitbutton"
Value="submit"
Type="image"
src="http://mysite.org/images/CmdButton-AddMeToThisEvent-2F8DBE.gif"
id="btn1"
width="190"
>
</form>
----This form works fine ---
<form
method=post
Id=frm03
Action="http://order.store.yahoo.com/cgi-bin/wg-order?mysite"
>
<input
Name=vwcatalog
Type="hidden"
Value=mysite
>
<input
Name=vwitem
Type="hidden"
Value=item2
>
<input
Name=vwquantity
Type="hidden"
Value=0
>
<input
Class="submitbutton"
Value="submit"
Type="image"
src="http://mysite.org/images/CmdButton-AddMeToThisEvent-2F8DBE.gif"
id="btn2"
width="190"
>
</form>
</form>
</body>
Steve
|
|
|
|
|
ASP.NET works by creating it's own form, you need to rewrite this to not use two forms.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for the reply!!
Is there any reason you can think of for why the complier does not put up a fuss when you add form tags or that the page seams to work when you put a blank form in frount of the other two?
Cheers:
Steve
|
|
|
|
|
I guess it's been left alone in case you have a valid reason for doing so. But anything that is in a form that you define will not work with ASP.NET, because ASP.NET relies on the form it creates being posted back.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm trying to move the mouse over a button with code but I can't.
I found this property "Control.MousePosition" but I can't do it.
Someone can help me?
Thanks
|
|
|
|
|
use the following API:
Public Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long
|
|
|
|
|
Thanks a lot, it works well!!
|
|
|
|
|
Also try setting the Cursor.Position property.
|
|
|
|
|
I would like to know if there is anyway to embed a thumbnail image inside an image file if the file doesn't alrealdy contain it's thumbnail. Most image files already have the embedded thumbnail so you can use Image.GetThumbnailImage Method, which in case of large files reduces the amount of time necessary to read the thumbnail, I would like to embed thumbnails for the images that don't contain it for (faster) future access.
Is there a way? Thanks!
|
|
|
|
|
Kramer_1982 wrote:
Most image files already have the embedded thumbnail
Really? Not in any documentation that I've seen on any image file formats.
Image.GetThumbnailImage() returns the thumbnail image of the Image object, not the image in the Image file. If there is no thumbnail generated for it yet, it will read the Image file generate the thumbnail image at the requested size, save it into the Image object, then return that to the caller.
The next time you request the thumbnail image, the cached version in the Image object will be returned to the caller. When you save the Image object back to a file, the thumbnail is not written to the file with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 15:11 Saturday 10th September, 2005
|
|
|
|
|
Yes, you're right (well not quite, the msdn help for Image.GetThumbnailImage() says that it looks for an embedded thumbnail first... I guess), but I think I didn't put the right question. If you save a file(TIFF or JPEG) in Photoshop for example, the file is saved along with it's thumbnail (in the actual file, not as a thumbs.db or anything like that... there is a checkbox in the Photoshop Save dialog). I want to know if I can do that with a VB application. Maybe saving the graphics does just that, but I'm not sure (you just said that it doesn't so...).
I hope this makes more sense. I tried to get a thumbnail with DrawImage(...) and it takes about 3-7 seconds for a 4000x4000 TIFF image, while using GetThumbnailImage() takes only 0.4 seconds for the same image (the image was generated in Photoshop with the Thumbnail checkbox checked).
Hope I was explicit enough, thanks for the prompt answer.
|
|
|
|
|
The thumbnail is an extension to the JPEG format. I can't find ANY documentation that says the Image class can save that extension.
All you can do is try to get the thumbnail, then save the Image. Load into Photoshop and see if the thumbnail is there or not.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have the following structure:
This is my object
Public Structure structTransoverride
Public Account_Name As String
Public PolicyNumber As String
Public TransCodeOrig As String
Public TransEffDate As String
Public Override_Action As String
Public Override_New_Renewal As String
Public Override_Transaction_Code As String
Public ModifiedDate As String
Public ModifiedUID As String
Public Plan_Year As String
Public RowNum As Integer
End Structure
I need to initialize it? And set the values in the below subroutine. How do I do this?
I need to initialize it? And set the values in the below subroutine. How do I do this?
NOTE==> It cannot be declared in Sub highLightRow it since it will have to be passed in
the sub routine below called doModify()
objTransoverride.RowNum = hit.Row?
objTransoverride.Account_Name = Convert.ToString(grd.Item(RowNum, 0))
Private Sub highLightRow(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim pt = New Point(e.X, e.Y)
Dim grd As DataGrid = CType(sender, DataGrid)
Dim hit As DataGrid.HitTestInfo = grd.HitTest(pt)
If hit.Type = grd.HitTestType.Cell Then
grd.CurrentCell = New DataGridCell(hit.Row, hit.Column)
objTransoverride.RowNum = hit.Row
grd.Select(objTransoverride.RowNum)
objTransoverride.Account_Name = Convert.ToString(grd.Item(objTransoverride.RowNum, 0))
objTransoverride.PolicyNumber = Convert.ToString(grd.Item(objTransoverride.RowNum, 1))
objTransoverride.TransCodeOrig = Convert.ToString(grd.Item(objTransoverride.RowNum, 2))
objTransoverride.TransEffDate = Convert.ToString(grd.Item(objTransoverride.RowNum, 3))
objTransoverride.Override_Action = Convert.ToString(grd.Item(objTransoverride.RowNum, 4))
objTransoverride.Override_New_Renewal = Convert.ToString(grd.Item(objTransoverride.RowNum, 5))
objTransoverride.Override_Transaction_Code = Convert.ToString(grd.Item(objTransoverride.RowNum, 6))
objTransoverride.ModifiedUID = Convert.ToString(grd.Item(objTransoverride.RowNum, 7))
objTransoverride.ModifiedDate = Convert.ToString(grd.Item(objTransoverride.RowNum, 8))
objTransoverride.Plan_Year = Convert.ToString(grd.Item(objTransoverride.RowNum, 9))
End If
End Sub
Public Sub DoModify()
Dim dTable As DataTable = Me.DataGrid1.DataSource
Dim bm As BindingManagerBase = Me.DataGrid1.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)
Dim dRow As DataRow = CType(bm.Current, DataRowView).Row
Me.lbNumRec.Text = Me.DsTransOverride1.Tables(0).Rows.Count.ToString()
Dim cEditTransOverride As New EditTransOverride
' object being passed
**********************************************
cEditTransOverride.ShowDialog(objTransoverride)
***********************************************
cEditTransOverride.Dispose()
Me.SqlDataAdapter1.Update(Me.DsTransOverride1)
Me.DsTransOverride1.Tables(0).Clear()
Me.SqlDataAdapter1.Fill(Me.DsTransOverride1)
Me.DataGrid1.Refresh()
End Sub
Where do I instantiate or initialize the object and to I make it public?
I will need to do a XXXXX objTransoverride As new structTransoverride ?
I will have this in my dialog form?
'Form overrides dispose to clean up the component list.
Public Overloads Sub ShowDialog(ByRef objTransoverride As structTransoverride)
'
' Do All the work that you want to i.e. the one that you have written in the Load
'
'
MyBase.ShowDialog()
End Sub
|
|
|
|
|
I HAVE SPEND TWO WEEKS ON MY YEAR PROJECT ONLY TO FIND OUT THAT I WAS DOING THE RIGHT THING BUT DID NOT USE ARRAY TO PASS MY PARAMETERS.CAN U HELP ME OUT? PLEASE.
I NEED TO OPEN A FILE USING ARRAYS,DISPLAY THE DATA ON THE CONSOLE AND THATS JUST IT.THE REST I'LL DO IT MYSELF 'CAUSE I DON'T WANT TO STRESS U.
HOPE TO HEAR FROM U SOON.
PLS
Sma
|
|
|
|
|
STOP SHOUTING! Or at least get your caps lock key fixed.
DJSMA wrote:
I NEED TO OPEN A FILE USING ARRAYS,DISPLAY THE DATA ON THE CONSOLE AND THATS JUST IT.
That is not enough information. I don't know what you mean by "open a file using arrays"? Do you mean you want to read the contents of a file into an array of some kind? Do you mean you have multiple files that you need to open and the filenames are stored in an array?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|