Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JuanAlbertoMD

@JuanAlbertoMD
About
Posts
14
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Security Permissions
    J JuanAlbertoMD

    Hello!! I am developing a control that serialize a DataSet and i want to use it in web but i have a problem, i get a System.Security.SecurityException, this is my code: --------------------------------------------------------------------------------- BinaryFormatter myFormat = new BinaryFormatter(); MemoryStream myStream = new MemoryStream(); myFormat.Serialize(myStream, myDataSet); // here is were i get the exception --------------------------------------------------------------------------------- I read in the VS documentation that i need to use a SecurityPermissionAttribute, but i don't know how to use this: [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] SecurityPermission(SecurityPermissionFlag.SerializationFormatter).Demand(); Somebody knows how can i use this to avoid that exception?? Thanks, Alberto Martinez

    C# question visual-studio security help tutorial

  • Hosting .NET Windows Forms Controls in IE
    J JuanAlbertoMD

    Hello!! I made a control which contains a RichTextBox and2 buttons. One button open a text file and the other save a text file: //---OPEN OpenFileDialog open = new OpenFileDialog(); open.Filter = "Text files (*.txt)|*.txt"; if (open.ShowDialog() == DialogResult.OK) richTextBox1.LoadFile(open.FileName); //---SAVE SaveFileDialog save = new SaveFileDialog(); save.Filter = "Text files (*.txt)|*.txt"; if (save.ShowDialog() == DialogResult.OK) richTextBox1.saveFile(save.FileName); And i want to host the control in Internet Explorer. Then i create an html file:

    RichTextBox Control

    And i Configure the Virtual Directory. I open the html page and i can see the control but when i want to open a text file an exception appears: System.Security.SecurityException: 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Also i configure the permissions in the .NET Framework 2.0 Configuration but the same exception appears. Somebody knows if i am missing something. Regards, Alberto Martinez

    C# csharp html dotnet winforms hosting

  • Using PathGradientBrush
    J JuanAlbertoMD

    Hello! I have this code: GraphicsPath path1 = new GraphicsPath(); path1.AddEllipse(10,10,100,100); PathGradientBrush brush1 = new PathGradientBrush(path1); brush1.CenterColor = Color.White; Color[] colorArray2 = new Color[] { ScaleColor(Color.White, 0.25f) }; Color[] colorArray1 = colorArray2; brush1.SurroundColors = colorArray1; ----------------------------------------------------------------------------------- public static Color ScaleColor(Color sourceColor, float scale) { int num1 = (int)(sourceColor.R * scale); int num2 = (int)(sourceColor.G * scale); int num3 = (int)(sourceColor.B * scale); if (num1 > 0xff) { num1 = 0xff; } if (num2 > 0xff) { num2 = 0xff; } if (num3 > 0xff) { num3 = 0xff; } return Color.FromArgb(num1, num2, num3); } --------------------------------------------------------------------------------------- this works fine but when i change the size of the ellipse and the width or height is zero my project shows an exception : Out of memory Somebody knows why this happen or why can i do to fix this? Regards, Alberto Martinez

    C# performance help question

  • Using CollectionBase
    J JuanAlbertoMD

    Hello!! I have created my own collection : [TypeConverter(typeof(MyCollectionConverter))] public class MyCollection { private Color color1 = Color.White; private Color color2 = Color.Black; private int value1 = 0; private int value2 = 0; private bool blink = false; private bool visible = true; private string nname = string.Empty; [Browsable(true)] public Color Color1 { get { return color1; } set { color1 = value; } } [Browsable(true)] public Color Color2 { get { return color2; } set { color2 = value; } } [Browsable(true)] public int Value1 { get { return value1; } set { value1 = value; } } [Browsable(true)] public int Value2 { get { return value2; } set { value2 = value; } } [Browsable(true)] public bool Blink { get { return blink; } set { blink = value; } } [Browsable(true)] public bool Visible { get { return visible; } set { visible = value; } } [Browsable(true)] public string Name { get { return name; } set { name = value; } } public MyCollection() { } } public class MyCollectionConverter : CollectionBase { public MyCollectionConverter () { } public int Add(MyCollectione) { return this.InnerList.Add(e); } public void AddRange(MyCollection[] es) { this.InnerList.AddRange(es); } public void Remove(MyCollectione) { InnerList.Remove(e); } public new void RemoveAt(int index) { InnerList.RemoveAt(index); } public bool Contains(MyCollection e) { return InnerList.Contains(e); } public MyCollection this[int index] { get { return (MyCollection)this.InnerList[index]; } set { this.InnerList[index] = value; } } } and in a click event i add some elements to the collection like this: MyCollectionConverter

    C# database

  • Using PropertyGrid and Collection Editor
    J JuanAlbertoMD

    Hello, I have 3 classes for example : public MainClass { private int maximum = 100; private int minimum = 0; private int valueC = 50; [Browsable(true)] public int Maximum { get {return maximum ;} set {maximum =value;} } [Browsable(true)] public int Minimum { get {return minimum ;} set {minimum =value;} } [Browsable(true)] public int ValueC { get {return valueC ;} set {valueC=value;} } public MainClass() { } } public ElementsClass { private PropertiesClass elementsProperties; [Browsable(true)] public PropertiesClass ElementsProperties { get {return elementsProperties;} set {elementsProperties =value;} } public ElementClass() { } } public PropertiesClass { private bool visible = true; private Color colorC = Color.Black; private bool blink = true; [Browsable(true)] public bool Visible { get {return visible;} set {visible =value;} } [Browsable(true)] public Color ColorC { get {return colorC;} set {colorC=value;} } [Browsable(true)] public bool Blink { get {return blink;} set {blink=value;} } public PropertiesClass() { } } In the MainClass i want to include a ElementClass property but i must be able to have an ElementClass array or collection and each ElementClass has the 3 PropertiesClass properties. What i don't know how to do :confused: is the next: I want to show the MainClass properties in a PropertyGrid, the ElementsClass data must open a new window like a collection editor showing a list of all the ElementsClass objects that i have created. Finally when i select some element in the list, the propertyGrid must show the PropertiesClass properties (visible, colorC, blink). Can somebody help me with this? Regards, Alberto Martinez

    C# tutorial data-structures help question

  • Problem with Visual Studio 2005
    J JuanAlbertoMD

    Hello! I have a problem with my Visual Studio 2005 i am using C#. When i have the designer and the code files open and i am editing some code and i write something it seems that the writing stops and if i continue writing only after a few seconds all what i wrote appears and when i start to write all this happen again so i have to wait always a few seconds while the Visual Studio do i don't know what :^) But when i only have the code file open this doesnt happen. It seems that when i write something the Visual Studio tries to save the designer, i saw that when the Visual Studio freezes the status bar changes and in the right side i see a rectangle and 15,15 and a rectangle with arrows and 1078 x 721. When Visual Studio back to normal i see the column number and line number, etc. Sombody knows what could be happening? Regards, Alberto Martinez

    Visual Studio csharp visual-studio help question

  • Using LinearGradientBrush
    J JuanAlbertoMD

    Hi, Thanks both of you for your help i already could do what i needed :-D Regards, Alberto Martinez

    C# tutorial question

  • Using LinearGradientBrush
    J JuanAlbertoMD

    I have a figure in a winform, a rectangle, and a NumericUpDown, its miniumum and maximun values are 0 and 100, i want that when i increase the NumericUpDown value the rectangle must change its color, for example when the value is 0 the rectangle color must be black and when i increase the value the rectangle color must turning into white, when the value is 100 the rectangle color must be completely white. I have seen some examples using LinearGradientBrush but i don't know exactly how to do that, somebody knows how could i do this? Regards, Alberto Martinez

    C# tutorial question

  • Time & Date
    J JuanAlbertoMD

    Hi, you can use this: label1.Text = DateTime.Now.ToLongDateString(); //date label2.Text = DateTime.Now.ToLongTimeString(); //time Regards, Alberto Martinez

    C# csharp

  • Rotating image in C#
    J JuanAlbertoMD

    Hello!! Well about rotate images i know a library in C# where you can draw many figures and insert images and you can rotate, scale and a lot more it's pretty cool: http://www.cs.umd.edu/hcil/piccolo/[^] Regards, Alberto Martinez

    C# tutorial csharp graphics xml help

  • Using Reflection
    J JuanAlbertoMD

    Hello!! Yes, i would like to know when your article is ready, thanks! Regards, ALberto Martinez

    C# question

  • Using Reflection
    J JuanAlbertoMD

    Hello! I want to "read" a dll file and get all its components, once that i do this i want to load the components into a ComboBox or ListBox, later i can select one of them and insert it into a windows form at run time. I think that maybe i can do this using Reflection but i don't know exactly how. Somebody knows how can i do somethig like this? Regards, Alberto Martinez

    C# question

  • problem creating a function
    J JuanAlbertoMD

    Hello!! I want to create a function in which i need for example click some button and obtain a value, then click somewhere in the win form and obtain a x, y value and finally click other button and make some math operations, so the function that i want must wait until i click the appropriate button or area in the win form, if i don't follow the right order the function must do nothing until i click the elements in the right order. Somebody knows how can i do this?:confused: Thanks, Alberto Martinez

    C# question help tutorial

  • Using c++ dll in c#
    J JuanAlbertoMD

    Hello! I am trying to use a DLL that contains functions of c++ in c # but I have not been able to make it, this DLL is of a software called LOOX Maker, which is a editor graphic that has many options reason why I want to reuse that code and not to have to program it again, also i have the source of this program, I have tried several things but I have not obtained it. somebody that has more experience in this type of things can help me? I can send the project to you where I am trying to use it and also the DLL and source code of LOOX Maker, I hope that somebody can help me.

    C# csharp c++ help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups