1 Out Of 700 Custom Controls Produces A Security Exception?

Jul 27, 2009

For some reason one of my controls produces the following excecption error when adding to the VS ToolBox:Request for the permission of type System.Security.Permissions.SecurityPermissions, mscorlib, Verion=2.0.0.0, Culture=neutral etcWe have identified it is this class within the Custom Control but we not sure whyit is erroring

View 2 Replies


ADVERTISEMENT

.NET For Each Exception On Custom Controls?

Dec 9, 2011

in VB.NET i have 2 custom controls, one is a TextBox and second one is a ComboBox.These have custom values like Bool _IsHidden and are added on runtime to a form.Now, at some point in the code I want to check if the _IsHidden is set to True or False and display that information. Since the user can edit this values when creating the control these are not set on creation.

So what I tried is:(all of this is on MDI Forms)

For Each frm as CustomForm in Main.MdiChildren If frm.MyName = calledBy Then 'this part is just to know which form called the form to create the object For Each cntrl as CustomTextBox in frm.Controls'DO Something
Next End if Next

Now.. if the first control is a custom ComboBox it thorws an error since it sees that it does not match the custom TextBox control..how do i get around this? By my understanding it should just go through all of the controls on the said form and just check those who match CustomTextBox control ?

View 2 Replies

Select Null Records Produces Exception Error

May 29, 2012

Not sure what I am doing wrong, but here is the code.

SQL Server Express 2008 R2
VB 2010
Private Sub FillDataSetAndViewGrid()

[Code].....

View 7 Replies

Hiding A Form Produces "Cannot Access Disposed Object" Exception

Apr 12, 2011

I am trying to write a program that takes the input of a CSV file, makes modifications, and prompts the user on how to handle certain modifications.

I have the parsing of the CSV file complete, the handling of most of the string manipulation down, and the user interface complete, except when it comes time to move onto the next record.

I had it display the form as a modal dialog, and used me.hide() once it was over to continue with the program. However, when it gets to the next ShowDialog(), it says that the object has been disposed! I've tried a modeless dialog, with a while loop that waits for a boolean to be flipped by a button on the dialog being clicked, but that, as predicted, did not turn out so well and just shot the processor load to 100%.

One thing I notice in looking around is that I have everything based on the "home" form, the initial one that comes up when the program is run. Is this incorrect coding? Does this require the prompt being on a child form?

View 7 Replies

Security Exception Trying To Create A Directory

Dec 17, 2011

I'm writing an installation program that needs to create a new Folder in the "Program Files (x86)" folder. I'm getting the following security exception:

System.Security.SecurityException was unhandled

Message=Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)

What do I need to do to get around this issue and create the desired Folder?

View 11 Replies

Computer.FileSystem.GetFiles Security Exception?

May 30, 2012

My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.ProgramFiles, FileIO.SearchOption.SearchAllSubDirectories, "MSAccess.exe")
or

[code].....

View 9 Replies

VS 2008 Security Exception When Writing To Event Log

Nov 24, 2009

I get the following error when I run my program on Windows 7 (x64) : The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security This is thrown on the following line:

[Code]...

View 9 Replies

.net - Multiple Exception Throwing With Custom Exception Class?

Jun 19, 2012

i have about 20 possible exception messages that i want thrown when an error occurs.i need somthng like this when catching the exception

Try
' do domthing
Catch ex As CustomInvalidArgumentException
'do domthing

[code]....

do i have to create a class that inherits from Exception for each type of exception?

View 1 Replies

Create A Custom Exception Without Inheriting System.Exception?

Dec 26, 2009

Is there anyway to create a Custom Exception without inheriting System.Exception?

my reason is that they have a lot of methods which i do not wish my Class to have.

View 1 Replies

How To Isolate Security Upgrade Requests To Certain Controls

Dec 29, 2009

I've been writing an application that deals with various system files as well as registry keys. For permission reasons, my application currently runs as administrator. But this isn't really necessary for my main application window, nor is it very appealing for the UAC dialog to pop up everytime my application is started. I've noticed frequently that for some programs, such as AVG, the UAC shield shows up on several buttons throughout the program, the clicking of which does bring up the UAC prompt. But the application as a whole does not demand administrator rights, these rights are only requested as needed. How to isolate security upgrade requests to certain controls and/or methods.

View 2 Replies

Winforms - Controls Based Security In A Windows Forms Application Using .NET?

Sep 5, 2011

I need to implement, Controls Based Security in a Windows Forms Application using VB.NET. I tried google but did not get anything much to work with.

I would like if someone, could suggest some books or tutorials.

View 1 Replies

Using Custom Assemblies In SSRS Warning Request For The Permission Of Type 'System.Security.Permissions.SecurityPermission

Sep 8, 2010

I wrote a custom assembly for SSRS that returns a jpeg for the background image in a textbox on the report.I followed all instructions on msdn in regards to security but i still receive the same error.

Below is my config information

<pre lang="x-xml"><PermissionSetclass="NamedPermissionSet"
version="1"
name="Barcode">

[code].....

View 6 Replies

VS 2005 Custom Exception Messages?

Jul 31, 2009

I am trying to learn .NET This is what I found on MSDN. I can create an exception class by using this code.

PHP 'Exception Class Code
Imports System
<Serializable()> _
Public Class copyException

[Code]...

View 2 Replies

Create Custom Exceptions To Inherit From System.Exception?

Jan 16, 2010

Is the only way to create custom exceptions to inherit from System.Exception?

I wish to create a class that can be thrown as an exception but i do not wish to inherit from System.Exception because i have a base [Object] class in my library which all my classes should inherit from and i wish my custom exception class could also inherit from it.

View 6 Replies

Index Out Of Range Exception In Custom Generic Collection?

Feb 25, 2009

I wrote a class which imports System.Collections.ObjectModel. For the management of the collection, I've written:

Default Public ReadOnly Property Item(ByVal vntIndexKey As Integer) As ItemType
Get
Return CType(mCol.Item(vntIndexKey), ItemType)

[code].....

View 4 Replies

Custom Tab Controls In .net?

Mar 27, 2010

i want to control my tab pages with custom buttons...now i want to hide my tabs from tab controls...

View 2 Replies

How To Add Custom Controls

Aug 1, 2010

I want to know how to add custom controls to vb.net.

View 6 Replies

Arguments For Custom Controls?

Nov 24, 2011

I've created custom buttons in a .dll and they work fine, so I thought I'd have a go at creating my own sort of listbox to replace the standard one in my applications. It's basically a panel with a few labels and a button (eliminating the need to select an item in standard listbox then click a seperate button). I want to add these panels to a panel on a form, at run-time, based on rows in a db.

If I try adding any arguments in the New() section of the class file it won't let me use the panel in my toolbox. Is there a way to pass arguments to custom controls, I need a new custom panel for each row in a db so need to pass an id to it to specify records; or even load the records in my application and create a new panel for each record, using info passed to it to fill in the labels on it. Or can I create the panel at run-time and refer to labels within the custom controls, setting their .text properties that way?

View 5 Replies

How To Create Custom UI / Controls

Mar 19, 2011

I would like to expand my knowledge of VB.NET and was looking at creating custom user interfaces or custom controls. The type of things I am thinking of is: [URL]s. How are those controls created? I imagine it involves using the existing controls in Visual Studio as a starting point, and altering them to suit your design?

View 2 Replies

Resizing And Custom Controls?

Dec 10, 2010

I'm not going to post my code for my transparentlistbox class, but here is a link to it.It's been working fine as is, until early this morning when I tried to set a different size.[URl]..For the longest time I placed a normal listbox control on a form and resized that, setting a new public variable of transparentlistbox to the same size/location as the original listbox, setting the visibility of the original to false, and adding the transparentlistbox to the form (me.controls.add).It looked like this:

[Code]...

Now, since I've moved some buttons around on my main form, I resized the original listbox control to be wider (same height though). When I tested, the transparentlistbox (code didn't change still set to original listbox size/location), the size was that of what I had the original listbox set to, before resizing?

So, I commented out all of the custom drawing/paint events/etc I could find for the transparentlistbox and tested, still stuck to the original size. I stepped line by line debugging and verified that transparentlistbox1.size=listbox1.size indeed matched the new resized size (but didn't actually resize)?

Last I did was comment out the transparentlistbox.visible and put back the listbox1.visible and listbox1 does indeed show with the new resized size? I'm not quite sure what to test next?

View 2 Replies

Use SVG In .net To Draw Custom Controls?

Nov 3, 2009

Is there a way to use SVG in vb.net to draw custom controls? Or any other way?

View 3 Replies

Adding Controls To A Custom Control

Jun 19, 2012

Is it possible to have a custom control (inherits from Control) and add sub-controls to it (like, a label for example)? Basically I want a composite control. I know controls can contain other controls, but if I try to add a control to MyBase.Controls, this doesn't work because that's readonly.

[Code]...

View 2 Replies

Create Custom Controls For Apps?

Oct 14, 2011

i need to create custom controls for my apps so how can I do that? Do I need a special software to do that?

View 3 Replies

Custom Controls - .net Inherits 2 Classes?

Jan 16, 2012

inherit from two classes in VB.net?We are developing Custom User Controls that inherits from say System.Web.UI.WebControls.Label. We are planning on implementing a bunch of these controls but they will share mostly the same additional properties. We are hopeful about centralising these properties.I have looked into interfaces but it seems they only 'contract' properties you need to implement.

View 2 Replies

Custom Controls Disposing & Memory?

Apr 14, 2010

I've been working on a few large custom controls, and I noticed that when I use them, my memory starts ballooning. If I add a control at runtime, it increases the memory, but when I remove the control, it decreases less than it increased. However, it would stop balooning at some higher value. So if go back in forth between pages (which adds and removes the control), the memory would look something like this:

1,000K|5,000K|4,000K|9,000K|8,000K... 20,000K|25,000K|21,000K|25,000K|21,000K|25,000K... etc I know it takes a while for the GC to run, but the memory would stay consistantly high for long periods of time.

I tried writing a Closing routine, where when I called it, the control looped trhough its children and disposed all the internal controls, which seemed to help a little, but the memory after running the control and disposing was still much higher than before running the control. I also use custom event addhandlers. Should I remove all these as well. It would be nice if I received a little guidance on this.

View 2 Replies

Get A Primer On Creating Custom Controls?

Dec 2, 2009

I am new to VB 2008 having spent most of my time in 2003. What is the recommendation for the best place to get a primer on creating custom controls in VB.NET. I prefer to use VB directly and not the WPF.

View 2 Replies

Handling Focus With Custom Controls?

Nov 3, 2011

I have a custom control I'm creating. When I click on it, it draws a dotted border and puts some nubs on it for resizing. This all works perfectly. Now I want it so when I click off of it, it deselects. I already have a variable to set up if it's selected or not and subs to draw/clear it. I just have to be able to detect when something else is selected or it gets clicked off of.

What I've Tried

My first and best solution to this was to use the LostFocus event, but, by custom control apparently won't let it fire. After some research, as far as I know, custom controls don't have Focus events because they are custom and could be changed (basically, you have to implement the focus events yourself).

My Question

Does anybody have a solution to either implement the focus events or a way to handle off clicking for custom controls?

Sources

Here is my controls current source:

Imports System.Drawing.Drawing2D
Public Class wDOMElement
Inherits Control

[Code]....

View 1 Replies

How To Declare The Custom User Controls

May 12, 2010

I am getting this annoying warning message "Object reference not set to an instance of an object." all the time because I created several custom user controls and drag it to a Windows form in a vb.net Windows application. I am using vs 2005 and dot.net framework v 2.0. This message pop up when I try to save the projector when I try to debug it in the Design mode.

View 2 Replies

Inherit From Custom Controls VS 2008

Nov 16, 2009

Is this possible? Must be surely but I've tried and come up short. I've created a very basic class (person) with 2 public properties, forename, surname. My user control is databound to this class and has 2 textboxes to store the properties.

I've built the control and can add the user control to a windows form but how can I add to a new user control (Staff) which will show my 2 existing textboxes and I can add dateJoined datepicker also??

View 6 Replies

Looping Through Custom Controls On A Form?

Dec 4, 2009

I have created a customised checkbox control (only the text and border appearance has been modified), and wanted to loop through them in a User quizto see which have been checked and are correct. I have used the Tag property (set to 1 or 0) to identify incorrect answers, and tried to loop through with the following code:For Each thing As GMAW.MyCheckBox In currentParent.ActiveMdiChild.Controls

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved