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
M

Mark F

@Mark F
About
Posts
112
Topics
44
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Heading text alignment problem
    M Mark F

    Thanks for the link. I used a label control for the heading. That way I could change the alignment and the font. Works fine.

    Web Development winforms help tutorial

  • Heading text alignment problem
    M Mark F

    Sorry for the ambiguity. Windows has a ContentAlignment property that aligns the text in a control from TopLeft to BottomRight, and also middles. I know that using CSS you can align textual content using the div as a container. I was wondering if there is a way to use the ContentAligment property values from a Windows form to set the div container css. So if the user selects MiddleLeft the text is aligned that way in the html markup.

    Mark

    Web Development winforms help tutorial

  • Heading text alignment problem
    M Mark F

    I am working on a page that allows a user some control over layout and formatting. I want the user to be able to align the heading of a page just like the Windows Forms ContentAlignment property. For example: TopLeft, MiddleLeft, BottomLeft, MiddleTop, and so on.

    Thanks, Mark

    Web Development winforms help tutorial

  • Checking for valid xml file.
    M Mark F

    Does such a thing require adding a new namespace?

    Mark

    XML / XSL xml database

  • Checking for valid xml file.
    M Mark F

    Before you read on, this is not about checking for valid XML syntax or schema. I would like to be able to check if the user is opening an XML file that has data for my application only. If they try to open any other XML file the application should warn them. The XML file data is serialized via XmlSerializer.

    Thanks, Mark

    XML / XSL xml database

  • XPathNavigator iterate and write
    M Mark F

    The xml is displayed in a TreeView control so alphabetical sorting by 'name' attribute was necessary. I worked out something similar to your reply and problem solved. Haven't had a prior occasion to use Linq however. Thanks for the help!

    modified on Friday, December 3, 2010 3:28 PM

    C# question

  • XPathNavigator iterate and write
    M Mark F

    I am using XPathNavigator to sort nodes by name. Is there a method for writing the sorted nodes to the same or different file?

            foreach( XPathNavigator item in navigator.Select( expr ) )
            {
                 // write to new document here...,
            }
    

    Thanks, Mark

    C# question

  • Form data printing problem
    M Mark F

    I'll give it a try. Thanks!

    C# question help

  • Form data printing problem
    M Mark F

    Luc Pattyn wrote:

    you should set PrintPageEventArgs.HasMorePages;

    I already thought of that. I also thought of setting the printrange to currentpage and then repeatedly call Print. Even that failed.

            pagesLeft = this.Print( e );
    
            if ( pagesLeft < cardsToPrint.Count )
            {
                e.HasMorePages = true;
            }
            else
                e.HasMorePages = false;
    

    The Print() method calls Graphics.DrawString() and draws the strings on the PrintDocument graphics rect. For a single page it works perfectly.

    C# question help

  • Form data printing problem
    M Mark F

    I created a UserControl that contains three RichTextBox controls. I added a PrintDocument property, and the methods required to print (Print, PrintPage, BeginPrint, etc). I have a loop that iterates the data and loads three strings in the RichTextBox controls, one to each control, and then calls PrintDocument.Print(). It should then print that page and get the next three strings of data to print. This works fine for the first page, but the other pages don't print. After calling PrintDocument.Print() the program returns to the main form that called the UserControl print method. How do I continue iterating through my loop to print more pages?

    C# question help

  • PrintDocument clipping / wrapping text problem
    M Mark F

    I figured it out after I found a reference that states: when passing a RectangleF as one of the parameters, DrawString automatically wraps the text inside the destination's bounding rectangle. So I changed by method call to:

    RectangleF cardBox = new RectangleF( rich.Bounds.X + 5, rich.Bounds.Y + 5, rich.Bounds.Width - 5, rich.Bounds.Height - 5 );
    g.DrawString( rich.Text, rich.Font, Brushes.Black, cardBox, frmt );
    

    The 'cardBox' rectangle is deflated by 5 pixels for padding. I also included a StringFormat to center the text on the card.

    Mark

    C# help database graphics question

  • PrintDocument clipping / wrapping text problem
    M Mark F

    I have the following code which prints three RichTextBox controls to a page. The format is Avery 5388 which is the perforated index card stock paper (8.5x11). The print preview shows the text in each box but the lines don't wrap. Any way to fix the wrapping problem?

        private void fcPrintDocument\_PrintPage( object sender, PrintPageEventArgs e )
        {
            cardDataTabPage.Focus();
            DrawPage( e.Graphics );
        }
    
        private void DrawPage( Graphics graphics )
        {
            Graphics g = graphics;
            Pen boxPen = new Pen( Brushes.Black );
    
            int pageWidth = fcPrintDocument.DefaultPageSettings.PaperSize.Width;
            int pageHeight = fcPrintDocument.DefaultPageSettings.PaperSize.Height;
            
            RectangleF srcRect = cardDataTabPage.ClientRectangle;
            RectangleF destRect = new Rectangle( 0, 0, pageWidth, pageHeight );
            
            float scaleX = destRect.Width / 850;
            float scaleY = destRect.Height / 1100;
    
            for ( int i = 0; i < cardDataTabPage.Controls.Count; i++ )
            {
                if ( cardDataTabPage.Controls\[i\].GetType() == richTextBox1.GetType() )
                {
                    RichTextBox rich = (RichTextBox)cardDataTabPage.Controls\[i\];
                    g.DrawRectangle( boxPen, rich.Bounds );  // draws 3x5 box where card should be
                    g.DrawString( rich.Text, rich.Font, Brushes.Black, 
                        rich.Bounds.Left \* scaleX, rich.Bounds.Top \* scaleY, new StringFormat() );
                }
            }
        }
    

    Thanks.

    C# help database graphics question

  • Problem getting propery values with ProperyInfo
    M Mark F

    Yes I have overloaded the ToString method. Below are the methods in my CustomColor class. My ToString method was incorrect!

        // This method is incorrect and ...,
        public new string ToString()
        {
            return string.Format("{0:X2}{1:X2}{2:X2}", \_Red, \_Green, \_Blue);
        }
    
       // Should be...
        public override string ToString()
        {
            return string.Format("{0:X2}{1:X2}{2:X2}", \_Red, \_Green, \_Blue);
        }
    

    Thanks for the help! Mark

    modified on Monday, March 1, 2010 11:53 AM

    C# css wpf testing beta-testing help

  • Problem getting propery values with ProperyInfo
    M Mark F

    I have a custom class TableProperties which has properties for CSS table styles. I have a CustomColor property that has a UITypeEditor to display the ColorDialog control and then convert the color value to a hex string (e.g., ffffff). When I iterate through the PropertyInfo collection the GetValue method returns the property type rather than the value.

            // Loop which displays the properties in a ListView control (Testing only).
            foreach (PropertyInfo pi in tableProperties.GetType().GetProperties())
            {
                name = pi.Name;
                ListViewItem lvi = listView1.Items.Add(name);
                theType = pi.PropertyType.ToString();
                lvi.SubItems.Add(theType);
                
                // this returns 'TblPropTest.CustomColor' rather than 'ffffff'
                value = pi.GetValue(tableProperties, null).ToString();
    
                lvi.SubItems.Add(value);
            }
    

    The PropertyGrid works fine with the custom properties. Thanks, Mark

    C# css wpf testing beta-testing help

  • PropertyGrid and Custom properties
    M Mark F

    I think you misunderstood my question. I need to add an expandable property like the Font property has when displayed in a PropertyGrid. MyProperty Category + MyProperty my property's value string Size size value color color value name name value etc...., How is this done? Thanks, Mark

    C# tutorial question

  • PropertyGrid and Custom properties
    M Mark F

    I have a custom property that has two string values and an int value. I need to display them in a PropertyGrid so that the property's UITypeEditor edits any of the three properties within that type. An example would be the "Font" type in a PropertyGrid. The name, size, unit, bold, etc. is part of the editor for that property type. Is PropertyDescriptor what I need? Thanks, Mark

    C# tutorial question

  • Saving text file with StreamWriter
    M Mark F

    After the text file was saved a webbrowser control attempted to navigate to the local document path. Since it's css Frontpage opened the file by default. This error was not readily apparent at first. >>>>>>>> :doh: Mark

    C# css help

  • Saving text file with StreamWriter
    M Mark F

    Frontpage is not running, and I am simply editing a .css document (text) in a RichTextBox. I doesn't make any sense that Frontpage opens after the file is saved in the RichTextBox control! Mark

    C# css help

  • Saving text file with StreamWriter
    M Mark F

    Anytime I open or save a .css file using RichTextBox.LoadFile() or .SaveFile() methods Frontpage opens the file. So I write the contents to disk using the following. Even so, Frontpage still tries to open the file!

    try
    {
    using (StreamWriter writer = File.CreateText(path))
    {
    foreach (string line in rich.Lines)
    writer.WriteLine(line);
    }
    }
    catch (IOException e)
    {
    // error handling here
    }

    Mark

    C# css help

  • MenuStrip and ToolStripButton corruption
    M Mark F

    Thanks, I'll give it a try.

    Windows Forms visual-studio 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