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
Y

Yaron K

@Yaron K
About
Posts
15
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Configurable font height/width
    Y Yaron K

    I think I got it to do what I want. Here is the code using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Drawing.Drawing2D; namespace FontSizeTest { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox txtH; private System.Windows.Forms.TextBox txtW; private System.Windows.Forms.TextBox txtStr; private System.Windows.Forms.Button btnGo; private System.Windows.Forms.PictureBox pictureBox1; private System.ComponentModel.IContainer components; public Form1() { InitializeComponent(); } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.panel2 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.txtH = new System.Windows.Forms.TextBox(); this.txtW = new System.Windows.Forms.TextBox(); this.txtStr = new System.Windows.Forms.TextBox(); this.btnGo = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.panel2.SuspendLayout(); this.SuspendLayout(); // // notifyIcon1 // this.notifyIcon1.Text = "notifyIcon1"; this.notifyIcon1.Visible = true; // // panel2 // this.panel2.Controls.Add(this.label2); this.panel2.Controls.Add(this.label1); this.panel2.Controls.Add(this.txtH); this.panel2.Controls.Add(this.txtW); this.panel2.Controls.Add(this.txtStr); this.panel2.Controls.Add(this.btnGo); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel2.Loca

    C# tutorial

  • Configurable font height/width
    Y Yaron K

    Thanks! will try that.

    C# tutorial

  • Configurable font height/width
    Y Yaron K

    hi I need to print text but the font height has to be configurable. I know I can change the font size at run time, but changing the font size changes both height and width proportioally. For example I need to increase the witdh X2 ,and the height X 4. Thanks!

    C# tutorial

  • Evaluating expressions
    Y Yaron K

    Thanks!

    C# tutorial database sql-server sysadmin question

  • Evaluating expressions
    Y Yaron K

    Thanks Jeff. I found something usefull in the MSDN: DataTable.Compute() and DataColumn.Expression() DataSet myData = new DataSet(); // myData.Tables.Add("Orders"); myData.Tables["Orders"].Columns.Add("ParentID", typeof(int)); myData.Tables["Orders"].Columns.Add("Exp", typeof(string)); myData.Tables["Orders"].Columns.Add("Exp2", typeof(string)); myData.Tables["Orders"].Columns["Exp"].Expression = "substring('abcdefg',2,3)"; myData.Tables["Orders"].Columns["Exp2"].Expression = "IIF(1=2,'A',iif(3>4,'B','C'))"; myData.Tables["Orders"].Rows.Add(new object[1] {123}); DataTable myTable; myTable = myData.Tables["Orders"]; // Declare an object variable. object objSum; objSum = myTable.Compute("substring('123456',3,2)", null); MessageBox.Show(objSum.ToString() + "\n" + myTable.Rows[0][1].ToString() + "\n" + myTable.Rows[0][2].ToString() );

    C# tutorial database sql-server sysadmin question

  • Evaluating expressions
    Y Yaron K

    Hi I am looking for a way to evaluate expression. An expression return exacly one result. The result may be a boolean, a number value a string, etc. The idea is I give my user a tool to define expression. The expression is built in MSSQL style, and can use SQL functions. For example: $Num1 > 100 AND $Num2 < 0 At run time my program replaces the variables with values, for example: 101 > 100 and 1<0 In the past, my application ran on the server. I used SQL itself for that: I passed it the string, received the return value and it was great. No I am writing a client-server application, and this code runs on the client. So I cannot go to the server all the time. Is there a way/class/object I can pass there expressions to on the client? I was thinking of using a dataset, but I can only see it can select records from a given data table. I cannot find how to perform such calculations. Thank you!

    C# tutorial database sql-server sysadmin question

  • Clearing JIT buffer
    Y Yaron K

    Hi I am trying to test the time it takes my .NET application to load 1st time. When the application is called the 1st time, the JIT compiler generates a native code. I am looking for a way to clear the cache which is holding thie native code, so I can measure the time the app takes to load accurately. Any tips would be welcome! thank you.

    .NET (Core and Framework) csharp c++

  • Data type lost when convertingto XML
    Y Yaron K

    Hi I am writing code which accepts an array of objects, converts them to XML and loads them into a dataset. My problem is that when the XML is created, it does not contain an indication of the data types of the fields. As a result, all the data types of the columns in the dataset are System.String. Is there a way to force creation of shcemea when creating the XML string? Here is the code: [Serializable] [XmlType("MyClass")] public class MyClass { [XmlAttribute("IntField")] public int IntField; [XmlAttribute("StringField")] public string StringField; [XmlAttribute("ByteField")] public byte ByteField; public MyClass() {} } string xmlString; System.Xml.Serialization.XmlSerializer xmlSer; XmlWriter xmlWriter; MyClass myObj = new MyClass(); StringWriter sw = new StringWriter(); myObj.IntField = 1; myObj.StringField = "a string..."; myObj.ByteField = 2; xmlWriter = new XmlTextWriter(sw); xmlSer = new XmlSerializer(typeof(MyClass)); xmlSer.Serialize(xmlWriter,myObj); xmlString = sw.ToString(); // at this point the xmlString looks as follows: //" //" DataSet ds = new DataSet(); StringReader sr = new StringReader(xmlString); ds.ReadXml(sr); // At this point ds.Tables[0].Columns[0].DataType.ToString() returns System.String instead of System.32

    C# data-structures xml json help question

  • Changing paper size at run time
    Y Yaron K

    Thanks, that works well.

    C# question

  • Changing paper size at run time
    Y Yaron K

    :confused:Hi I have a code which prints to the printer using the PrintDocument & PrintPreviewDialog classes. I need to specify at run time which paper size I want to use: A4, Letter, A3 etc. These are not custome sizes but rather standard sizes, listed in the PaperKind enum. How can I force a certain paper size at run time? The PaperSize.Kind property is read only. I tried using the PageSetupDialog too, hoping that I could simply pass it the requierd page size without having to display the dialog, but could not make it work. thanks

    C# question

  • Changing the paper size at run time
    Y Yaron K

    Thanks, but i still have the same problem. I am trying to: private void pd_PrintPage(object sender, PrintPageEventArgs e) { e.PageSettings.PaperSize.Kind = PaperKind.A3; } but i does not compile because PaperSize.Kind is read-only.

    C# question

  • How should I call an exe file using C#
    Y Yaron K

    Try Exec ? See help.

    C# csharp question

  • PrintDocument PrintPage event
    Y Yaron K

    Worked like a charm. many thanks!!!

    C# question

  • Changing the paper size at run time
    Y Yaron K

    Hi I have a code which prints to the printer using the PrintDocument & PrintPreviewDialog classes. I need to specify at run time which paper size I want to use: A4, Letter, A3 etc. These are not custome sizes but rather standard sizes, listed in the PaperKind enum. How can I force a certain paper size at run time? The PaperSize.Kind property is read only. thanks

    C# question

  • PrintDocument PrintPage event
    Y Yaron K

    Hi When previewing a document using the PrintDocument class: when i receive a PrintPage event, how can I tell if it's for printing on the screen or the printer? I want a slightly different output when printing to the printer. Thanks

    C# 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