Click here to Skip to main content
15,903,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: how i make my vb6 appliction compatible to Vista? Pin
Mycroft Holmes14-Jul-08 17:49
professionalMycroft Holmes14-Jul-08 17:49 
GeneralRe: how i make my vb6 appliction compatible to Vista? Pin
Vimalsoft(Pty) Ltd14-Jul-08 22:26
professionalVimalsoft(Pty) Ltd14-Jul-08 22:26 
GeneralRe: how i make my vb6 appliction compatible to Vista? Pin
r_mohd14-Jul-08 21:16
r_mohd14-Jul-08 21:16 
GeneralRe: how i make my vb6 appliction compatible to Vista? Pin
Vimalsoft(Pty) Ltd14-Jul-08 22:24
professionalVimalsoft(Pty) Ltd14-Jul-08 22:24 
QuestionWriting to a Mapped Network drive Pin
Stephen Lintott13-Jul-08 20:54
Stephen Lintott13-Jul-08 20:54 
AnswerRe: Writing to a Mapped Network drive Pin
Stephen Lintott13-Jul-08 21:25
Stephen Lintott13-Jul-08 21:25 
GeneralRe: Writing to a Mapped Network drive Pin
Dave Kreskowiak14-Jul-08 4:39
mveDave Kreskowiak14-Jul-08 4:39 
AnswerRe: Writing to a Mapped Network drive Pin
Mycroft Holmes14-Jul-08 17:58
professionalMycroft Holmes14-Jul-08 17:58 
QuestionHow to give VISTA look to my window application form...VB.NET 2.0 Pin
koolprasad200313-Jul-08 20:29
professionalkoolprasad200313-Jul-08 20:29 
AnswerRe: How to give VISTA look to my window application form...VB.NET 2.0 Pin
N a v a n e e t h13-Jul-08 20:50
N a v a n e e t h13-Jul-08 20:50 
AnswerRe: How to give VISTA look to my window application form...VB.NET 2.0 Pin
Vimalsoft(Pty) Ltd14-Jul-08 5:05
professionalVimalsoft(Pty) Ltd14-Jul-08 5:05 
QuestionVB6 : How to create 2nd sheet in excel (.csv) when using Print function? Pin
cocoonwls13-Jul-08 17:59
cocoonwls13-Jul-08 17:59 
AnswerRe: VB6 : How to create 2nd sheet in excel (.csv) when using Print function? Pin
Dave Kreskowiak14-Jul-08 4:29
mveDave Kreskowiak14-Jul-08 4:29 
QuestionPreventing file access Pin
im_hoser13-Jul-08 13:12
im_hoser13-Jul-08 13:12 
AnswerRe: Preventing file access Pin
Dave Kreskowiak14-Jul-08 4:31
mveDave Kreskowiak14-Jul-08 4:31 
GeneralRe: Preventing file access Pin
im_hoser14-Jul-08 8:14
im_hoser14-Jul-08 8:14 
GeneralRe: Preventing file access Pin
Dave Kreskowiak14-Jul-08 15:09
mveDave Kreskowiak14-Jul-08 15:09 
QuestionText translation Pin
Agweet13-Jul-08 5:10
Agweet13-Jul-08 5:10 
JokeBuy some dictionaries. Pin
CPallini13-Jul-08 21:52
mveCPallini13-Jul-08 21:52 
AnswerRe: Text translation Pin
Steven J Jowett14-Jul-08 13:10
Steven J Jowett14-Jul-08 13:10 
GeneralRe: Text translation Pin
Agweet14-Jul-08 20:18
Agweet14-Jul-08 20:18 
QuestionSystem.Drawing.Region Serialize/Deserialize Pin
lobotomizzato13-Jul-08 5:02
lobotomizzato13-Jul-08 5:02 
I have a class with a Region property, that I need to serialize/deserialize (using BinaryFormatter)

My class implements ISerializable and uses a second property to do the job
My code so far:

Private Property MyRegionData() As Byte()
    Get
        Return Me.MyRegion.GetRegionData.Data
    End Get
    Set(ByVal value As Byte())
        Dim reg As New Region
        Dim data As Drawing2D.RegionData = reg.GetRegionData
        data.Data = value
        m_MyRegion = New Region(data)
        reg.Dispose()
    End Set
End Property

Private m_MyRegion As Region = Nothing
Public Property MyRegion() As Region
    Get
        Return m_MyRegion
    End Get
    Set(ByVal value As Region)
        If m_MyRegion IsNot Nothing Then
            m_MyRegion.Dispose()
        End If
        m_MyRegion = value
    End Set
End Property

Public Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) Implements ISerializable.GetObjectData
    info.AddValue("MyRegion", Me.MyRegionData, GetType(Byte()))
End Sub

Public Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
    MyBase.New()
    Me.MyRegionData = DirectCast(info.GetValue("MyRegion", GetType(Byte())), Byte())
End Sub


This code works, but i worder if there is a better way to deserialize it.
Region does have a constructor that takes a RegionData, but RegionData doesn't have any public constructor (that's why i use a second region object to get a RegionData).

Thanks for your help
Questionhelp please Pin
zero_angel12-Jul-08 14:36
zero_angel12-Jul-08 14:36 
AnswerRe: help please Pin
Paul Conrad13-Jul-08 7:31
professionalPaul Conrad13-Jul-08 7:31 
AnswerRe: help please Pin
Vimalsoft(Pty) Ltd14-Jul-08 5:09
professionalVimalsoft(Pty) Ltd14-Jul-08 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.