|
Is your .EXE being launched from a network share or network mapped drive latter? If so, this is probably the source of your problem. Code running from any remote source, by default, is not trusted. You can learn about Code Access Security here[^]. It's a pretty large topic, and affects everything you do while using the .NET Framework so it's a good idea to understand, at the very least, the basics of how, and why, code security works.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am student of final year engineering student. I selected “SMS Website” as my project topic. In this I have to send Bulk SMS through website and provide other kind of services related to SMS.
Please tell me which steps I should follow to make this kind of software.
Please send me some material or any kind of source code related to it.
I need your help.
Thank you!!!
Contact Me: ashish.0619@gmail.com
|
|
|
|
|
Why don't you start by reading up on how to send SMS messages first[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All,
Anybody knows how to drag drop multiple rows from one datagridview
to another.I know how to drag drop single row.If any body have idea please
guide me how to do this.
Thanks,
venkat
|
|
|
|
|
I take it you're sending a DataRow object when you call SetData? Off the top of my head, you can probably create your own implementation of the IDataObject interface and encapsulate 1-n DataRow objects in it (implement your own collection of them), then just send that object instead of the one DataRow.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello everybody...
can any one plz tell me how to resize our windows application form according to monitor size????
The exact requirement is ....I have Developed an vb.net windows application..
I have done this in a lcd moniter..bcz of this the controls are in size which fits to lcd moniter.
now my problem is when my application is used in ordinary moniters some controls r out of the screen..
I have tried setting windows form size to normal..its not woking ..
PLS GIVE ME ALTERNATIVE WAY OTHER THAN RESIZING THE CONTROLS IN MY FORM....
Thanx
BINO VARGHESE
|
|
|
|
|
There's a Screen class (from memory ) which has a PrimaryScreen property that you can get the screen size. Or, you can just set it to maximise.
BINO VARGHESE wrote: bcz of this the controls are in size which fits to lcd moniter.
There is no such thing as LCD monitor size. An LCD typically goes lower than a CRT of the same size, but still supports all standard sizes.
BINO VARGHESE wrote: PLS GIVE ME ALTERNATIVE WAY OTHER THAN RESIZING THE CONTROLS IN MY FORM....
You should never resize controls, you should set the anchor or dock properties so they position themselves.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
Are you asking about the theme of the window or the controls in the window?
|
|
|
|
|
It's just two list boxes, I don't think it has a name. It's common in web sites, is that where you want to set it up ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi!
I'm stuck on a inheritance/typecast problem and would like some help.
I have two modules named Main.vb and Test.vb with the following contents:
'---------------- Test.vb ------------------------------------------------------
Imports SHDocVw
Module Test
Public Class clsTest
Public HWND As Long
'
' Omitted additional members goes here.
'
End Class
Public Sub doSomething(ByRef c() As clsTest)
Dim i As Integer
Dim ieCollection() As InternetExplorer = Nothing
'
' Omitted code that populates ieCollection goes here.
'
i = 0
For Each ie As InternetExplorer In ieCollection
' [Insert #1]
c(i).HWND = ie.HWND
i += 1
Next
End Sub
End Module
'---------------- End of Test.vb -----------------------------------------------
'---------------- Main.vb ------------------------------------------------------
Module Main
Private Class clsTestExtended
Inherits Test.clsTest
Public strParam1 As String
Public strParam2 As String
End Class
Public Sub main()
Dim ce() As clsTestExtended = Nothing ' [Change #1]
' [Insert #2]
Test.doSomething(ce)
For Each c As clsTestExtended In ce
c.strParam1 = ""
c.strParam2 = ""
Next
End Sub
End Module
'---------------- End of Main.vb -----------------------------------------------
This is my problem:
If I insert the following piece of code at the [Insert #1] marker in Test.vb:
If c Is Nothing Then
ReDim c(0)
Else
ReDim Preserve c(i)
End If
c(i) = New clsTest
then, on return from Test.doSomething, I get a runtime error:
Unable to cast object of type 'clsTest[]' to type 'clsTestExtended[]'
If instead of the above modification, I change the line marked [Change #1] in Main.vb to
Dim ce(1) As clsTestExtended
and insert this piece of code at the [Insert #2] marker in Main.vb :
ce(0) = New clsTestExtended
ce(1) = New clsTestExtended
then I get no runtime error (assuming the 'For Each' loop in Test.doSomething doesn't loop more than twice). The problem is that the main() sub can't/shouldn't know before the call to Test.doSomething how big the ce array will be on return from Test.doSomething and so dimensioning ce before the call to Test.doSomething is not safe.
What I really want to use is the first modification but without the typecast problem or another solution to the problem that achieves the same thing (which is: the main() sub works with the inherited 'ce' classes while the doSomething sub can dynamically change the 'c' classes and have the changes made available to the main() sub in the 'ce' classes).
Any ideas?
Best Regards,
Anders
-- modified at 16:00 Friday 1st December, 2006
|
|
|
|
|
Why are you using an array instead of dynamic container ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian,
Thanks for the quick reply!
Ummm, 'dynamic container' I think I need some hints here. Never heard of that before. Still trying to absorb all the new NET stuff.
Best Regards,
Anders
|
|
|
|
|
Your first step should be to remove references to the VisualBasic namespace. I suspect this is where Redim and so on are coming from. VB.NET contains a lot of bad stuff from VB6, only because MS was forced into it by people complaining. They are all in that namespace. Delete that, or you'll end up coding VB6 in .NET and not get the full benefit of moving.
If it's VS2005, you can create a List<baseType>, which is a generic container, to which you can add and remove objects at will. You therefore don't need to redim anything. If you ever need an array, those containers offer methods that return them.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Did some reading about Lists and generics and they look really useful. I'm not sure though how Lists and generics can solve my main problem (which is having the 'doSomething' sub work with the list as if it is a list of 'clsTest' objects while the 'main' sub can work with the same list as if it is a list of 'clsTestExtended' objects) but maybe that will become obvious if I do some more reading on the subject.
Best Regards,
Anders
|
|
|
|
|
I need to know how to make the DateTimePicker control in VB 2005 to basically real-time update itself. I want the DateTimePicker to keep track of the time. Guidence?
|
|
|
|
|
Well, the control really wasn't meant to be used the way you want to, but it's probably possible if you drop a Timer control on your form, set it for 1000 millisecond interval, then handle the Timer's Tick event. In the event handler code, just set the DateTimePicker's Value property with the current DateTime.Now().
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I can't get motherboard name on visual basic 2005. What way i can use instead of WMI functions???
because with WMI doesn't work!!! =(((( if somebody knows way please mail me: serg_212@mail.ru
-- modified at 17:15 Thursday 30th November, 2006
|
|
|
|
|
WMI *does* work.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
The WMI method is about the ONLY method you have. But, it will only work if the MoBo manufacturer includes the proper WMI Provider drivers to actually supply the information to WMI.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
O thank you for your answer but when i install soft witch determine motherboard name, temperature,
voltage and etc and this program is really works. And i'am very suprised when my code doesn't work!!! =(((( I want to know what method is use by that programms in gettting motherboard name????
|
|
|
|
|
Because the app doesn't use WMI to get it's information, it has to use the Win32 API function GetSystemFirmwareTable[^] to get this kind of information. There is no support for it in the .NET Framework BCL. Beyond that, it's a custom read of physical memory locations.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
O thank you!!! For this moment I didn't know a way(instead of WMI of course) in getting hardware information and etc.Later, I want to test this API function on Visual Basic 6!!!! I think it will work!!!
|
|
|
|
|
I'm just learning VB.NET and am writing some code that will poll the network and display status boxes within a form. This works fine using something, displaying a nice status strip kinda thing about 50 pixels high (+ the title bar).
But ... Now I come to rotate the form to show it vertically, and find that it seems to have a minimum width which is rather wide !!!
I find that setting the MinimumSize doesn't help. And trying to set the width in the code doesnt help either. It wont get smaller than 123 pixels. This restriction is also experienced in the Design window if manually creating a form.
If I remove the minimize box and maximize box from the form I can resize it to a narower size when the program is running (around 65 pixels), but the 'size' function wont take it to this width.
Now I guess there is something limiting the narowest width that you can chose for a form, but it does seem rather daft.
Maybe I shouldn't be using a Form, but it does everything I want. I have searched the web and the forums and can't see any reference to this restriction, which makes me think I'm missing something obvious !
Please help put me at rest and get me thinking about something else.
Thanks
Nigel
|
|
|
|
|
Probably because a small form like that is seldom ever used. Try changing the FormBorderStyle to SizableToolWindow or FixedToolWindow to see if that gives you what you want.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|