|
Is it possible in VB.NET to change the active scripting settings between enabled and disabled? (Tools>Options>security>custom level is where it can be found manualy)
If not, can the internet settings window be opened (without opening internet explorer)?
Thanks
|
|
|
|
|
It's possible to do, but most assuredly not easy to do or understand. It involves a bunch of COM interop work that, frankly, is not going to be easy to understand or explain. Examples are just about non-existant. This would be a large trial-and-error project.
It's possible to luanch the Internet Settings control panel using the Process class. The command line would look something like this:
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl
displays Internet Properties, General Tab
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,0
displays Internet Properties, General Tab
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,1
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,2
.
.
.
Basically, the number at the end displays one of the tabs in the control panel.
-- modified at 16:52 Wednesday 18th April, 2007
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
If a visual basic project is created in visual studio 2005 professional can it be modified in the standard version?
|
|
|
|
|
If a visual basic project is created in visual studio 2005 professional can it be modified in the standard version?
|
|
|
|
|
Yes.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
It also depends on what the app is written for. For example, Office development isn't supported on the Standard Edition. Read more of the differences here[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hello to everyone!
I have a problem about changing the properties of an object in a Class module. Before in Visual Basic 6 i used this code to change the properties a control
Form1.Label1.Caption="...."
Then how about VB.Net?
Please help me...
Mark Angelus V. Movida
3rd yr. BSCS
St. Dominic Savio College
|
|
|
|
|
Never used vb6, but I believe 'caption' has been replaced with '.text'?
so... form1.label1.text = "...."
|
|
|
|
|
Hello!
Im trying to follow your code but! Theres no object appeared in the pop-up menu. I think theres only two (2) choices: (1) ActiveForm and (2) ControlCollection. But I don't know how to use that two properties.
Thank you for helping me!
Mark Angelus V. Movida
3rd yr. BSCS
St. Dominic Savio College
Philippines
|
|
|
|
|
A class, unless it's the form itself, shouldn't care anything about any controls outside of it. This only worked in VB6 because, due to VERY bad practice, every form was visible to every piece of code in the app as a "global". This is, thankfully, no longer the case in VB.NET due to true OOP support.
Your class should expose a status property that the form code can use to update itself. This class could even expose an event that the form could subscribe to so it get's a notification that the status has changed.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hello every one
I need to create button when the program is running,i wrote the code but the CLICK event is not enable and when i click on button ,no event happen.how is it solved?
|
|
|
|
|
You have to wire up the events you want to handle yourself. If you have to also destroy the button in your code, you have to disconnect the event handler too.
You use AddHandler and RemoveHandler[^] for these purposes.
To wire up the Click event of a button, it's as easy as this:
Dim myButton As New Button
myButton.Location = ....
Me.Controls.Add(myButton)
AddHandler myButton.Click, AddressOf MyButtonHandler
.
.
.
' The method signature must match the normal button click event handler signature!
Private Sub MyButtonHandler(ByVal sender As Object, ByVal e As System.EventArgs)
' Button Click code goes here...
End Sub
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
How to create a multithreading application?
Mark Angelus V. Movida
Programmer
|
|
|
|
|
Open a new project and start coding??
Really, this is not an answerable question. There are many thousands of possible applications for multi-threading. What you do depends entirely on what your application is doing and the situation for which you need it.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
After three days i could'nt find how to handle message. i know it is very simple because i did it in delphi. Found an article in codeproject articles, but that code not true code for me. I just want to send message (with sendmessage api) to my parent window, and handle thats all.
is there anybody experienced this subject ???
|
|
|
|
|
Hi, if I recall correctly:
In your parrent window, use SetWindowLing API with GW_WNDPROC constant and address of a function (whose signature you may find in MSDN).
SetWindowLong returns a pointer to oldproc of the window wich you must save in a variable and pass the events to this procedure, at the end of your new windowproc.
now in the child window and the parrent window, creat a message using RegisterWindowMessage which returns a unique window_message handle.
Then in the child window call SendMessage with the registered windows handle and in parent form check it out!
jope it was helpful
|
|
|
|
|
Hi,
I am trying to write a login script that checks the exchange server currently set up in the User's outlook profile and change it to a new one if needed.This should be possible (i think) but i can't seem to get a handle on it.
All i need to know is how/where i can access/change the Exchange server currently set up for that user's outlook profile. I know i can access some outlook properties through WMI but none get or set the exchange server it connects to.
Could anyone point me in the right direction?
|
|
|
|
|
Hi all,
I have a VB.Net Application that is run over Citrix. Everytime I try to run from the Citrix shortcut I get Application has generated an Exception that cannot be handles. The thing is the other 2 developers don't have this problem. And After it was rolled out to clients, 100 people work but I have one user that gets the same error.
Does anyone have an idea what is going on here?
TIA,
Chuck Easter
-- modified at 10:50 Wednesday 18th April, 2007
PS.. I can run the project when I run from the file share. Just not thru the shortcut.
Forgot to say that the first time.
|
|
|
|
|
There's no way to tell what's wrong without knowing what the Exception is or what the application was doing at the time it bombed.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
having problems with adding to the database.
the code i have should work, but nothing is getting added to my database. below is the code i have. can anyone pinpoint my broblem and rectify it for me?, thanks
Imports System.Data.OleDb
Public Class cust
Public conn As OleDbConnection
Public comm As OleDbCommand
Public dr As OleDbDataReader
Public da As OleDbDataAdapter
Dim icount As Integer
Dim str As String
Private Sub cust_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn = New OleDbConnection 'establishes that conn is a new connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\PCbank.mdb" 'the name of the connection (name of the database on the end)
conn.Open() 'opens the connection
comm = New OleDbCommand 'establishes that comm is a new command
comm.Connection = conn 'the connection for the command is the connection specified
comm.CommandType = CommandType.Text 'the commands are in text
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
conn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=PCbank")
conn.Open()
comm = New OleDbCommand("insert into customers(CustomerID,CustomerSurname,CustomerForename) values('" & (tbID.Text) & "','" & (tbSur.Text) & "','" & (tbFor.Text) & ")", conn)
icount = comm.ExecuteNonQuery()
MsgBox("record inserted")
Catch ex As Exception
End Try
conn.Close()
End Sub
End Class
|
|
|
|
|
You appear to be using the Try/Catch/Ignore anti-pattern. Don't! You will lose vital diagnostic information doing that. The application may be screaming out the reason for the failure and you are just ignoring it.
|
|
|
|
|
Try to write MsgBox(ex.Message) in you Catch statement.
This can tell you a lot about the problem.
I haven't looked your code over in detail.
But one thing that was differen from my code was this:
OledBCommand oCommand = oCon.CreateCommand()
Let your command be created by your connection.
And don't just comm.Connection = conn
But I doubt that this will solve all your problems.
If you get some interesting errors from the Catch, post it again
Programming code is like magic, just use the right code (magic words) to make happen what you want..
|
|
|
|
|
Your problem, or at least one of them, is in this line of code:
comm = New OleDbCommand("insert into customers(CustomerID,CustomerSurname,CustomerForename) values('" & (tbID.Text) & "','" & (tbSur.Text) & "','" & (tbFor.Text) & ")", conn)
There should be a single quote after (tbFor.Text) & ". The line should look like this:
comm = New OleDbCommand("insert into customers(CustomerID,CustomerSurname,CustomerForename) values('" & (tbID.Text) & "','" & (tbSur.Text) & "','" & (tbFor.Text) & "')", conn)
|
|
|
|
|