Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Source] [C#] Upside Down Text
#1
Well, I just saw something with a flip text, and I decided to release something I had already worked on in C#. All you need is to create two textboxes, and for the first textbox, make sure you enable the textbox_textchanged event by clicking the lightning bolt symbol in the textbox properties and finding textchanged.

Source:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Upside_Down_Text
{
    public partial class Form1 : Form
    {
        char[] backwardLetters = {
                                   'ɐ', 'q', 'ɔ', 'p', 'ə', 'ɟ', 'ƃ', 'ɥ', 'ı', 'ɾ', 'ʞ', 'l',
                                   'ɯ', 'u', 'o', 'd', 'b', 'ɹ', 's', 'ʇ', 'n', 'ʌ', 'ʍ', 'x', 'ʎ', 'z',
                                   '∀', 'q', 'Ɔ', 'p', 'Ǝ', 'Ⅎ', 'פ', 'H', 'I', 'ſ', '丬', '˥', 'W', 'N',
                                   'O', 'Ԁ', 'Ό', 'ᴚ', 'S', '⊥', '∩', 'Λ', 'M', 'X', 'ʎ', 'Z',
                                   'Ɩ','ᄅ','Ɛ','ㄣ','ϛ','9','Ɫ','8','6','0',
                                   '¡','¿','„','\'',',','(',')','‾','v','"','_',

                                   ']','[','}','{','/','\\','>','<','˙','.'
                                 };
        char[] normalLetters = {
                                 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
                                 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
                                 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
                                 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
                                 '1','2','3','4','5','6','7','8','9','0',
                                 '!','?','"',',','\'',')','(','_','^','„','‾',

                                 '[',']','{','}','\\','/','<','>','.','˙'
                               };
        public Form1()
        {
            InitializeComponent();
        }

        private string reverse(string s)
        {
            string r = "";
            for (int i = s.Length - 1; i > 0; --i)
            {
                r += s[i];
            }
            return r;
        }

        private int getCharNumberInArray(char c, char[] array)
        {
            for (int i = 0; i < array.Length; ++i)
            {
                if (array[i] == c)
                    return i;
            }
            return -1;
        }

        public string subString(
               [DescriptionAttribute("The string to use.")]string s,
               [DescriptionAttribute("The position to start getting the substring.")]int pos,
               [DescriptionAttribute("The length the substring will extend from the position.")]int length
            )
            
        {
            bool start = false;
            for (int i = 0; i < s.Length; ++i)
            {
                
            }
            return s;
        }

        private void normal_TextChanged(object sender, EventArgs e)
        {
            string word = "";
            if (normal.Text != "")
                word += normal.Text.Substring(0, 1);
            char[] normalText = normal.Text.ToCharArray();
            for (int h = 0; h < normalText.Length; ++h)
            {
                int i = getCharNumberInArray(normalText[h], normalLetters);
                if (i >= 0)
                    word += backwardLetters[i];
                else
                    word += normalText[h];
            }
            backward.Text = reverse(word);
        }
    }
}

Download project:
http://www.rvgaming.net/csharp/upsidedowntext.php

Feedback Appreciated.

- Rev
Reply
#2
I might have to try this out sometime.
Reply
#3
Thanks for source code....
[Image: 20r9vh4.jpg]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Source ] Hemp Tycoon App [/Source] VB.net KoBE 8 9,749 03-05-2012, 10:30 PM
Last Post: SomeWhiteGuy?
  TextBox2.Text | Transfer Text to ListBox Die 3 2,673 01-02-2012, 06:09 PM
Last Post: AceInfinity
  [Source]Sql Database Project [Source] Digital-Punk 0 1,439 10-16-2011, 07:01 AM
Last Post: Digital-Punk
  [Source]Batch to Exe converter[Source] Digital-Punk 6 2,982 10-15-2011, 03:00 AM
Last Post: Digital-Punk
  [Source]File Assembly changer Vb.Net[Source] Digital-Punk 0 3,102 10-13-2011, 06:35 PM
Last Post: Digital-Punk

Forum Jump:


Users browsing this thread: 1 Guest(s)