|
The Activated event is triggered after the load (and every time the form is activated)
One can use a flag (to indicate first activation) and the activated event to solve the problem.
class form
inherits Windows.System.Forms.Form
...
Private _firstActivation as boolean = true
Private Sub frmMain_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
If (_firstActivation) Then
_firstActivation = False
Dim frm As New Login
Dim res as DialogResult = frm.ShowDialog(me)
' Login Succeeded / Failed functionality
End If
End Sub
...
end class
hth,
Q.
|
|
|
|
|
If you open your login screen like this:
frmMain.Show 'Displays frmMain
frmLogin.Show vbModal 'Displays Login form
It should act like a message box, not allowing the user to access any other form.
Hope this helps.
|
|
|
|
|
I have created a button that when clicked would like it to allow me to embed a word file to the page becasue I want to give a user the option to attatch information based on a question to a word form. Any help would be great. I dont know any VB code either huh!!
|
|
|
|
|
Let me see if I understand what you are asking correctly. You have an app that asks the user a question. You would like the user to be able to click on a button that would bring up a blank Word processor page so that the user can input information and have it stored next to the question? Am I way off?
Thanks,
Taen
|
|
|
|
|
Sorry if im confusing you a little. I would like to have a button on a form that when the user clicks on it, brings up a file attatchment window so the user can select to embed the new object to the page. In word if you go to Insert > Object it gives you options to embed a document. What the problem is, is that when you protect a form in word it revokes these controls hence not allowing the user to do it manually by way of me telling them using comment boxes on the form, instead I would like a button that can open this window. Thanks for your help.;)
chris
|
|
|
|
|
So when the user attaches the Word doc do you want it displayed or just a placeholder icon like and attachment that when double click will open the doc?
Sorry for so many questions...
Thanks,
Taen Karth
|
|
|
|
|
just a placeholder icon like and attachment that when double click will open the doc? If it is possible yeah
Cheers
Chris
|
|
|
|
|
I would you the OpenFileDialog contrl to go find the file and then once selected I would either insert it into the database, assuming you have a backend database design, or I would add it as a LinkLabel or PictureBox with a link to the external file.
Does that help?
Thanks,
Taen Karth
|
|
|
|
|
I do not have a database only as word file and want to create an embedded document on the page so when clicked upon it opens this file. Im word you can go to Insert>Object and here select the file to attatch to the word document. It then creates a link in the page. My problem is that when I protect the form, this option is not available to me from the insert menu so I have placed a button on the page and would like to know if it is possible to add code that will open the Insert>object dialog box. when I click on the button it gives me this code
Private Sub CommandButton1_Click()
End Sub
|
|
|
|
|
Agh! My sample code uses 'Type', but VS.NET tells me it is no longer supported - I am to use 'Structure' instead. So I need help converting this from type to structure:
Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", <server>);
Help?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
That's not going to work. Type.GetTypeFromProgId will always return a Type, not a structure. There is no way to convert one to a structure either.
If you use Type.GetTypeFromProgId on a COM server, like "Scripting.FileSystemObject", it will always return a type of System.__ComObject . What are you trying to do with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The code is copied verbatim from the microsoft site:
http://msdn.microsoft.com/library/en-us/wmsrvsdk/htm/creatingaspserverobj.asp?frame=true
---
// Create a remote WMSServer object from a System.Type object and
// the CreateObject method.
Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", "remote_server_name");
WMSServer wms = (WMSSServer)Server.CreateObject(tServerType);
// Create a remote WMSServer object from a System.Type object and a
// System.Activator object.
Type tServerType = Type.GetTypeFromProgID("WMSServer.Server", "remote_server_name");
WMSServer wms = (WMSServer)Activator.CreateInstance(tServerType);
---
(I realize this is ASP. I am confounded at the interplay between VB froms and ASP pages and the code on each. Half the samples I want are in ASP and half are in VB, and frankly I don't understand how the two work together in Visual Studio.)
In VB, a sample looks like this:
---
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Dim tServerType As Type
Dim RemoteServer As WMSServer
Try
tServerType = Type.GetTypeFromProgID("WMSServer.Server", "server_name")
' Create an instance of the remote server object locally.
RemoteServer = Activator.CreateInstance(tServerType)
---
but, no matter WHAT I try, I get 'access denied'. I have been configuring my systems for 5 days now.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
Do you have two servers for your app? One is the web server and the other is a media server with Window Media Services installed? Are they arranged in a domain environment or are they workgroup with each having it's own set of user accounts?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Two servers: one web, one media. Different domains. I could set them up in the same domain if you think thast would make things easier.
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
|
|
|
|
|
DaveC426913 wrote:
Different domains
That's why you're getting "Access Denied". Your web code is running under the ASPNET account on one domain, who's SID does not exist in the other. Your best solution is to get both servers into the same domain.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Iam tryin to create a macro that when run will open a window so I can attatch a file to a protected form within microsoft word. This is doing my head in now becasue Im not sure if it can be done or how and I have no knowledge of VB whatsoever. Any help would be much appreciated.
Many Thanks
|
|
|
|
|
Does Crystal Reports come with any versions of VB .NET?
|
|
|
|
|
I know that Enterprise Architect version comes with some Crystal reporting features but I don't think it is the full blown Crystal Reports.
Hope that helps...
|
|
|
|
|
Hi,
I have to update a program while it is working. First i stop the process of programme then i copy new files and restart the process of program.At this time i see 2 system tray icon of my programme. When i move mouse over them the killed process's icon removes itself. But i want it to be destroyed when i first kill it's process.Could someone help me plz?
--junior coder--
|
|
|
|
|
You can't remove th icon yourself since your application was stopped and/or terminiated by the debugger. There's no way to run any removal code for the icon if your code is no longer running. You just have to put the mouse over the orphaned icon and let it get kicked by the System Tray. No, there's no way to force the System Tray to do this.
Even if you could write an app to force the System Tray to clean itself up, wouldn't it just be quicker to pass the mouse over the Tray, instead of finding and double-clicking another icon?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
got a problem:
table in excel(with names A, B):
A B
----------
1 Hallo
1 wie geht es dir?
2 schlecht!
3 nein,
3 eigentlich gut!
I want the result:
A B Resultat C
-------------------------------------------
1----Hallo----------------
1----wie geht es dir?-----Hallo wie geht es dir?
2----schlecht!------------schlecht!
3----nein,----------------
3----eigentlich gut!------nein, eigentlich nicht
How does the makro-code look like????
Thank`s for helping!!!
nico
|
|
|
|
|
If I want to edit a specific row in a dataset, e.g. I want Column(2)Row(5) to equal 100, How do I go about doing that?
|
|
|
|
|
mydataset.mytable.rows(5).item(2)=100
|
|
|
|
|
Or if you know your dataset field names you could use:
dim myDataRow as DataRow<br />
myDataRow = mydataset.tables(tablename).rows(x)<br />
myDataRow.Item(FieldName) = 100<br />
|
|
|
|
|
Hi,
I need to print my file on printer thru my vb.net application. I created the file with formfeed operations. But while printing, file datas printed are not moved formfeeded properly.
Be simple and Be sample.
|
|
|
|