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
T

THEMYTH

@THEMYTH
About
Posts
31
Topics
18
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Creating enum at runtime and showing it on a property grid
    T THEMYTH

    Hi coders, I am planning to create an enum at runtime and set it as a property of a class. That is,

    Class MyClass
    Public Property Type As (New Created Enum)
    ....
    End Class

    For creating an enum at runtime I have used the following code

     Public Function CreateEnum() As \[Enum\]
            Dim domain As AppDomain
            domain = Threading.Thread.GetDomain
            Dim name As New System.Reflection.AssemblyName
            name.Name = "EnumCounters"
            Dim asmBuilder As System.Reflection.emit.AssemblyBuilder
            asmBuilder = domain.DefineDynamicAssembly(name, Reflection.Emit.AssemblyBuilderAccess.Run)
            Dim modBuilder As ModuleBuilder
            modBuilder = asmBuilder.DefineDynamicModule("EnumModule")
            Dim enumBuilder As EnumBuilder
            enumBuilder = modBuilder.DefineEnum("EnumCounters", TypeAttributes.Public, GetType(Integer))
    

    '----- HERE IS WHERE I ADD THE ITEMS
    For i As Integer = 0 To DiagManager.Counters.Count - 1
    enumBuilder.DefineLiteral(CType(DiagManager.Counters(i), Counter).Caption, i)
    Next
    '-----
    Dim enumType As Type = enumBuilder.CreateType
    Dim enumObj As [Enum] = System.Activator.CreateInstance(enumType)

            Return enumObj
        End Function
    

    Then, I set my property's value as the returned value of the function. For full code please see (http://emreyazici.com/CodeFormatter.htm -- site does not have banners or advertisement. I only wrote the code) Normally it would work. But when I assign the 'selectedobject' property of 'property grid' to the created instance of class, it does only display the FIRST item of enum in the property grid http://emreyazici.com/res.jpg But I want it to show all items How may I correct it? Thanks...

    Best Regards Emre YAZICI

    Visual Basic css com question

  • Header with combo
    T THEMYTH

    Thank you for your answer I have thought that before, but I am not going to use the headers in a listview. Thanks anyway Best Regards Emre YAZICI

    Visual Basic php help question

  • Header with combo
    T THEMYTH

    Hello coders, I am looking for a way to develop a Header Column with a ComboBox Dropdown button. A sample is shown in here.. http://img510.imageshack.us/my.php?image=headerwithcombo4ge.jpg Please help me if you know a way to develop that (it could be only a message to be sent to header or another control) Thanks. Best Regards Emre YAZICI

    Visual Basic php help question

  • Deserialization Problem
    T THEMYTH

    Hi all, I have a serialization class with following procedures. Public Shared Sub Serialize(ByVal Obj As Object, ByVal FilePath As String) Dim fs As New FileStream(FilePath, FileMode.OpenOrCreate) Dim sf As New SoapFormatter sf.Serialize(fs, Obj) fs.Close() End Sub Public Shared Sub DeSerialize(ByRef Obj As Object, ByVal FilePath As String) Dim fs As New FileStream(FilePath, FileMode.Open) Dim sf As New SoapFormatter Obj = sf.Deserialize(fs) fs.Close() End Sub As it can be guessed, these methods are used for serializing and deserializing objects. I have a class to be serialized public class SampleClass Private Value as Integer Private Items As New ArrayList end Class When I serialize this class, the output will be shown like the data below. (That shows the class has been successfully serialized) (PLEASE IGNORE THE NAMES AND VALUES IN THE DATA - IT IS ONLY A SAMPLE) ..... ...... 6 <_Name id="ref-12">ID UniqueIdentifier true ...... ......(continues)... But when I try to deserialize a class (from the data file), only the "Private Value as Integer" variable is deserialized. How can I also deserialize an arraylist? Best Regards Emre YAZICI

    Visual Basic question json help

  • Collection / Property Grid
    T THEMYTH

    Hello coders, I have been designing an application which contains a class called table. There is a property called RelatedTables whose type is also a collection of tables ( I have created an extra class called TableList which extended from the ArrayList class ) In runtime, I do assign the selectedobject property of a propertygrid to a new instance of the table class, like below dim p as new Table PropertyGrid1.SelectedObject = p As we all guess, the property grid will be filled with the properties of the class. As I mentioned there is a property called RelatedTables which is a collection of the Tables. I would like to add items(tables) which have been created before (in run time), to collection (RelatedTables) How can I do that? Thank you. Best Regards Emre YAZICI

    Visual Basic question css

  • Assigning
    T THEMYTH

    Hello, I am trying to assign a class to another whose types are different. (please do not say ctype, it will not work) Consider that the following class below public Class time public hour as byte public minute as byte public second as byte end class I want to assign a DATE to this class e.g dim i as new Time i = Today.Now 'Time=Date When I do that, I want the compiler to call a method, which will allow this conversation e.g Sub A_Sub(value as object) if typeof value is date then me.hour = value.hour me.minute = value.minute me.second = value.second end if end Sub How can I do that? I think i need to use ExpandableObjectConverter class but not sure Please help Thank you Best Regards Emre YAZICI

    Visual Basic question help

  • Reqular Expressions
    T THEMYTH

    Hello coders, I am trying to seperate one line of vb code into lines by vbcrlf (carriage return - linefeed) or the colon : characther As you know Dim i: i=3 statements are exactly the same as Dim i i=3 I have the following code to be seperated. Dim input As String = "Function X(i As String):Dim q As integer=" & vbCrLf & "Dim P as byte" Normally , If I use the Dim pattern As String = "[\n|.*:*.]" pattern it will be seperated into three lines (as I wanted) But If I use the following line , it will be into 4 lines (I do not want it to be happened) Dim input As String = "Function X(i As String):Dim q As integer=""q:p""" & vbCrLf & "Dim P as byte" I need to modify the pattern, which will not accept colons inside quotes. How can I do that? Thank you for you time Emre YAZICI Best Regards Emre YAZICI

    Visual Basic question regex

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    I am actually going to write a control class with only apis (without using nativewindow class) For the Events, I will use the WindowProc Api to handle the events For the drawings, I will use the MoveToEx LineTo DrawText FillRect... apis For the styles and messages, I will use SetWindowLong and SendMessage apis As I mentioned , the double buffer could be created by using the CreateCompatibleDC api, which creates an extra buffer for graphical operations. Thank you Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    Of course it comes from the usage of native drawing functions Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    Of course, c++ is the best way of doing that, I was looking for a way to do it in VB.Net or C#.Net Thank you anyway Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    I tried both, I mean 1 ) I have tried writing a grid control with usercontrol and .net frameworks' Graphics object( using Drawline, FillRect...) 2 ) I have tried the same thing with CreateWindowEx, LineTo, MoveToEx .... When I compare them the second one was faster than the first one This is why i want to use APIs Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    Well Thank you for your answer Your answer was just like i guess SetWindowsLong api does not support all of these styles, we need to use others i think Why dont I call the SeetStyle , because i do create a window using CreateWindowEx and all the other operations like Moving, Showing the window or drawing line, filling a rectangle will be performed by APIs. I want to do everything with apis. Because the way is faster!! Thanks anyway.. Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    Thank you for your answer. I know what the ControlStyle bits, and I know what is it doing, the reason why i am asking for a way to perform the SAME thing(as SetStyle does) I think we are able to set the styles with API e.g (As I mentioned) Instead of SetStyle (opaque,true) you can use the SetBkmode API, and (I am not sure) instead of Double buffer, you can use CreateCompatibleDC API. I am asking for the other ones' apis. Do you know them? Thanks Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • Setting Style (SetStlye Method) With API
    T THEMYTH

    Hi coders, I was wondering about the apis used while writing the SetStyle Method. I am creating an API control class using NativeWindow class in .net framework. I need to set styles of the window (like double buffer, userpaint, resize redraw...) Some of these styles can be applied by using SET... apis (like instead of SetStyle Opaque, True ; SetBkMode api can be used) I need to know the apis used for all other styles in ControlStyles enum. Thank you for your time Best Regards Emre YAZICI

    .NET (Core and Framework) csharp dotnet wpf json

  • parent, showing a form
    T THEMYTH

    Hello, I have been developing a program. There are lots of forms, and I do need to show some of them(when they become necessary) I was using a method to show a form inside a picturebox. I have used the SetParent and GetParent apis to perform the operation that I wish in Visual Basic 6. I was able to show a form inside a picture box or frame. Show I can Load and Unload forms that I want. How can I do that in C#? Thank you for your time. Best Regards Emre YAZICI

    C# question csharp

  • Showing a form inside a control
    T THEMYTH

    Hello I was able to show (load and show) a form , from inside a picturebox or frame in VB6. I mean that, I could show a form named F2, inside a frame named fr which was placed on the form named F1. There is a form named F1, there is a control (frame) placed on the form F1. And I was able to show the F2 form inside the frame. How can I do that in VB.NET ? Thanks... Best Regards Emre YAZICI

    Visual Basic question csharp

  • Showing Form
    T THEMYTH

    Hello, I was wondering about how am I able to show another Form object from vb.net? Also how can I access of modify a property of an object e.g.: Form2.Text1.Text = "testing" Thanks Best Regards Emre YAZICI

    Visual Basic question csharp testing beta-testing

  • Firehose
    T THEMYTH

    thanks for your help There are lots of tables, It occures just for ONE table. We are using a client of a network The database is on the SERVER of the network There is a strange thing that I do not understand I am able to update the record , when I add a new record. e.g. There are 10 records I have added a new one, after I updated the 8th one . After this there are 11 records, and the 8th record has been updated successfully. please contact for further information if necessary Best Regards Emre YAZICI

    Database help sharepoint database sql-server sysadmin

  • Firehose
    T THEMYTH

    Hello I have a problem while trying to edit a record on SQL Server 2000 (Sp 3). The problem occures, w hen I click to "Return all rows" in the context menu of the table, and I tried to uptade a record . It occures an error. The error message says : "Transaction cannot start while in firehose mode" I have researched a little about firehorse, but could not find any useful information. I look forward to hearing from you thanks Best Regards Emre YAZICI

    Database help sharepoint database sql-server sysadmin

  • Executing a string value
    T THEMYTH

    Thank you for your answer My problem is more complicated. Please consider there is a textbox and a button in my form When i click to the button the code that i wrote it into textbox , must be executed. But i will not use only msgbox. I will use all of the Vb.NET functions like (int - left - mid ....) I used to develop it in vb6 using scripting control object it was able to use ... script1.execute text1.text like this.. It executes the code that i have written into textbox. Thanks Best Regards Emre YAZICI

    Visual Basic question csharp com tools
  • Login

  • Don't have an account? Register

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