|
No, I don't know of any issues here, or ways to deal with them, sorry.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok no problem, I will check some more blogs out and hopefully find something, thank you for your help
|
|
|
|
|
It may be the threading because even if I try to change the layout of form1(main form) from the event it hangs the program ie
Me.WindowState = FormWindowState.Maximized
|
|
|
|
|
Hi Christian
I managed to get it write and thought you may be interested, it's pretty funny it only takes two lines of code. It was the issue of the child thread. The way to get round the problem is :
Imports System.Threading
Public Class Test
Public t As Thread
Public Sub Start()
t = New Thread(AddressOf tstartdes)
t.Start()
End Sub
Public caller As New MethodInvoker(AddressOf newform)
Public Sub tstartdes()
Form1.ActiveForm.Invoke(caller)
End Sub
Dim F As Form
Public Sub newform()
F = New Form2
F.Show()
End Sub
End Class
The method invoker is what does it, it is then invoked from the main thread running the main form.
Yay ... It's working
|
|
|
|
|
This is how your supposed to do it. Although it's possible to create forms on other threads, I don't recommend it because people, who mostly don't understand threading, always run into weird problems like this and can't seem to comprehend why it doesn't work. They spend dyas screwing around with a problem that's easily avoidable if you remember to keep all of your GUI elements (including entire forms) on the GUI thread and shovel off the real work to background threads.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all,
I have a datagrid displayed on a page with a few data column, one of the column is 'name'. can i create a hyperlink on the name field (to create link to other pages)? btw, i'm using vb.net. & mssql server (db) ,& still a beginner.
Thanx in advance.
|
|
|
|
|
Hi,
What I need to do is simple in concept but could be difficult to do, if at all. I need to know if it can be done.
I've got an application (Notification Icon) from which I launch different applications, and if they are already launched, simple set focus to them. This is simple enough when I create an instance of each application, on request, from my main application, and call a show/setfocus command if they already exists.
But what I would like to achieve is for these instances to continue running, even when my main application is shut down or crashes.
The shell command is an option, but I need something that provides more control.
Any Ideas?
|
|
|
|
|
If you just need to launch another application and forget about it, Shell could work fine for you.
If you need more control, you can look MSDN about System.Diagnostics.Process or System.Diagnostics.ProcessStartInfo
Marco Turrini
|
|
|
|
|
System.Diagnostics looks like it should do. I'll give it a try.
Thanks
Robert
|
|
|
|
|
You say that ‘you need to generate a new GUID so you have a new version’ how to generate a new GUID. I see on Project Property Window a ‘DLL Base Address’ is it useful for me please help me.
Sasmi
|
|
|
|
|
Please don't make a new post when you're discussing the same problem, respond to my post instead.
Do you know what a GUID is ? It's the unique ID that represents your COM object. The base address has nothing to do with it. I have to admit, I have no idea how it's set in VB6, I've only done it in C++. From memory, there's a text file which contains the GUID. Do NOT make up a GUID, use the tool to generate one for you. Make sure you also give it a new name, because in VB you generally use the name, not the GUID.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for giving direction.
Sasmi
|
|
|
|
|
Hi Guys,
I Have a dll name 'XYZ.dll' which i use in my project call 'ABC' and install it on users pc and i use same dll 'XYZ.dll' (with some major changes) in my another project call 'PQR' if i install this pqr on users PC i found it overwrite the first one dll which is use in 'ABC' project. can any one help me regarding this i am first time using this dll funda in vb6. if any one give me detail idea about 'How to use dll' it will really great for me.
Thanks in advanced
Sasmi
|
|
|
|
|
I assume this is a COM dll, otherwise you could just put the dlls in the directories with the apps and it would be fine.
You've done the wrong thing, and there's no easy way around it. If you're going to change a COM dll, you need to generate a new GUID so you have a new version. Either way, you should never break existing functionality, only add new functionality.
In .NET, dlls are not registered, and are just loaded from the local directory. This change was made because the recommended way to use COM would work fine, but too many people just didn't bother to do it properly/thoughtfully.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi, How do I create a comma delimited text file and write data from SQL database in it using Vb .net?
|
|
|
|
|
Please don't cross post.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i have to draw pie chart on my application run time.i used this way.
create a graphic object and then draw lines.
my problem is when from minimize or other form come over that from,drawing is refreshing(erasing)
is there a way to prevent this.
|
|
|
|
|
No - you need instead to do it properly - draw it in your paint handler.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have no idea why some idiot voted you a 1...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
*grin* Good advice often attracts low votes, because what people want is a slab of code that works despite violating how Windows itself functions
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You don't stop this. You actually need to have this! When another window is dragged acrossed your chart, it has to repaint itself. Put all of your drawing code in the Paint event of the control you're drawing this chart on and it'll do just that.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Putting the code in the event is one way of doing it and probably the best way if your pie chart is constantly changing. Another way would be to create a bitmap object and set the image propertie to the bitmap and it windows will handle the redrawing for you but you should really try doing it the correct way.
Recreating the wheel is the best way to appreciate what the previous coders have gone through to get you where you are at now.
|
|
|
|
|
I am using VS 2002. I have put the code down below. I have a module that creates a systray application. Ideally I would like to hit the Form123_load on the class from the module so it will execute a listener for a hotkey.
I have a sub called staticmethod that does execute my messagebox but only if the login button is pressed (so the module must require an action). How can I have it access the form123_load sub from the module automitically when the program runs without an action placed upon the module?
Thank you!
Module Imports systray1.vbAccelerator.Components.HotKey
Public Class Form123
Inherits vbAccelerator.Components.HotKey.HotKeyForm
Shared Sub staticmethod()
MessageBox.Show("hello")
End Sub
Public Sub Form123_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' add an event handler for hot key pressed (or could just use Handles)
AddHandler Me.HotKeyPressed, AddressOf hotKey_Pressed
' set the hotkey:
Dim htk As HotKey = New HotKey("My HotKey", Keys.Up, HotKey.HotKeyModifiers.MOD_CONTROL Or HotKey.HotKeyModifiers.MOD_SHIFT)
Me.HotKeys.Add(htk)
'this is a test
'show a messagebox:
End Sub
Private Sub Form123_Closed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed
' remove the dynamic event handler
RemoveHandler Me.HotKeyPressed, AddressOf hotKey_Pressed
End Sub
Private Sub hotKey_Pressed(ByVal sender As System.Object, ByVal e As HotKeyPressedEventArgs)
' ensure form is shown:
Me.RestoreAndActivate()
'show a messagebox:
MessageBox.Show(Me, _
String.Format("HotKey Pressed:" + vbCrLf + "Name: {0} " + vbCrLf + "KeyCode: {1}" + vbCrLf + "Modifiers: {2}", _
e.HotKey.Name, _
e.HotKey.KeyCode.ToString(), _
e.HotKey.Modifiers.ToString()), _
".NET Hot Key Demonstration", _
MessageBoxButtons.OK, _
MessageBoxIcon.Information)
End Sub
End Class
Module systray
Private systray As New NotifyIcon()
Public Sub Main()
Dim mnu As New ContextMenu()
Dim mnuitem As New MenuItem()
Dim mnuitem2 As New MenuItem()
'First
mnuitem.Text = "Exit"
AddHandler mnuitem.Click, AddressOf EndApp
mnu.MenuItems.Add(mnuitem)
'second
mnuitem2.Text = "Login"
AddHandler mnuitem2.Click, AddressOf LoginApp
mnu.MenuItems.Add(mnuitem2)
systray.ContextMenu = mnu
systray.Icon = New Icon(Application.StartupPath & "\systray.ico")
systray.Visible = True
Application.Run()
'try to access the form
Form123.staticmethod()
End Sub
Private Sub LoginApp(ByVal sender As Object, ByVal e As EventArgs)
systray.Visible = True
Dim frmchklogininstance As New frmLogin()
frmchklogininstance.Show()
'try to access the form
Form123.staticmethod()
End Sub
End Module
Public Sub Main()
'try to access the form
Form123.staticmethod()
End Sub
End Module
Public Class Form123
Inherits vbAccelerator.Components.HotKey.HotKeyForm
Shared Sub staticmethod()
MessageBox.Show("hello")
End Sub
Public Sub Form123_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'ideally i would like to hit this sub
' MessageBox.Show("hello")
End Sub
End Class
|
|
|
|
|
hi all,
i got a problem here about session, i am trying to store IDs into a session for anyone who opens our website, in other words, i am going to give every visitor (no matter registered or not) of our website an ID, and store those IDs into a session, and finally put those IDs and all items the visitor want to purchase into a seperate table in the database.
urgent!!looking forward ur reply!!!
thanks
Jackie Ding
|
|
|
|
|
Sounds like an ASP.NET question. Which bit is causing you grief ? What do you mean by 'seperate table', you want a table per user, including anonymous ones, or a table per session ? Either idea is a bad one, BTW.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|