Click here to Skip to main content
15,882,278 members
Home / Discussions / C#
   

C#

 
AnswerRe: If existing String Form name, get that by database then open Pin
Pete O'Hanlon15-Mar-13 1:12
mvePete O'Hanlon15-Mar-13 1:12 
GeneralRe: If existing String Form name, get that by database then open Pin
V.15-Mar-13 3:44
professionalV.15-Mar-13 3:44 
GeneralRe: If existing String Form name, get that by database then open Pin
Mycroft Holmes15-Mar-13 13:39
professionalMycroft Holmes15-Mar-13 13:39 
QuestionResolving dependent projects Pin
Bernhard Hiller15-Mar-13 0:15
Bernhard Hiller15-Mar-13 0:15 
AnswerRe: Resolving dependent projects Pin
Pete O'Hanlon15-Mar-13 1:38
mvePete O'Hanlon15-Mar-13 1:38 
Questionsubstring from form1 to form2.... Pin
Goaty6510914-Mar-13 17:15
Goaty6510914-Mar-13 17:15 
AnswerRe: substring from form1 to form2.... Pin
Jibesh14-Mar-13 17:35
professionalJibesh14-Mar-13 17:35 
GeneralRe: substring from form1 to form2.... Pin
Goaty6510914-Mar-13 18:57
Goaty6510914-Mar-13 18:57 
Figured it out, dunno how I mucked it up at first, here's how you do it correctly.

my button from form1
C#
private void buttonSched_Click(object sender, EventArgs e)
        {
            string instText = comboInst.GetItemText(comboInst.SelectedItem);
            string folder = instText.Substring(0, 4);
            Schedule Open = new Schedule(instText);
            Open.Show();
        }


Calling is in form2:
C#
public partial class Form2 : Form
    {
        private string start;

        public Form2(string inst)
        {
            InitializeComponent();
            this.start = inst;
        }

private void Schedule_Load(object sender, EventArgs e)
        {

            System.Windows.Forms.MessageBox.Show(start);
}


Quite simple, I know, but I was thinking too much into something that didn't really need that deep of thought. Thanks for the looks! Hope this helps someone in the future.

BTW - you can alter the string after it's been called to the new form. I.E.

C#
System.Windows.Forms.MessageBox.Show(start.Substring(0, 4));


This is what I needed the code to do, grab the first 4 characters from the string. Now I can use the string raw, or formatted if I like. Thanks again!
QuestionBlueTooth Bytes Disappearing Pin
C-P-User-314-Mar-13 13:03
C-P-User-314-Mar-13 13:03 
QuestionView in Nhibernate Pin
hadi_ganji14-Mar-13 6:06
hadi_ganji14-Mar-13 6:06 
AnswerRe: View in Nhibernate - Repost Pin
Richard MacCutchan14-Mar-13 6:24
mveRichard MacCutchan14-Mar-13 6:24 
QuestionUnable to set registry value Pin
sjs4u13-Mar-13 21:27
sjs4u13-Mar-13 21:27 
AnswerRe: Unable to set registry value Pin
dusty_dex14-Mar-13 5:07
dusty_dex14-Mar-13 5:07 
QuestionHow to use CreateTextServices in C# Pin
cpw999cn13-Mar-13 20:32
cpw999cn13-Mar-13 20:32 
AnswerRe: How to use CreateTextServices in C# Pin
Bernhard Hiller13-Mar-13 22:01
Bernhard Hiller13-Mar-13 22:01 
GeneralRe: How to use CreateTextServices in C# Pin
cpw999cn13-Mar-13 22:40
cpw999cn13-Mar-13 22:40 
QuestionC# Receive from TCP send to COM2 Pin
dockwomblejr13-Mar-13 11:55
dockwomblejr13-Mar-13 11:55 
AnswerRe: C# Receive from TCP send to COM2 Pin
jschell14-Mar-13 7:57
jschell14-Mar-13 7:57 
GeneralRe: C# Receive from TCP send to COM2 Pin
dockwomblejr14-Mar-13 13:05
dockwomblejr14-Mar-13 13:05 
GeneralRe: C# Receive from TCP send to COM2 Pin
micke.andersson15-Mar-13 6:03
micke.andersson15-Mar-13 6:03 
Questionhow can i index files in c# Pin
Member 888804413-Mar-13 10:26
Member 888804413-Mar-13 10:26 
AnswerRe: how can i index files in c# Pin
R. Giskard Reventlov13-Mar-13 10:40
R. Giskard Reventlov13-Mar-13 10:40 
QuestionSplit with Regex Pin
Revolty13-Mar-13 8:21
Revolty13-Mar-13 8:21 
AnswerRe: Split with Regex Pin
Dave Kreskowiak13-Mar-13 9:30
mveDave Kreskowiak13-Mar-13 9:30 
GeneralRe: Split with Regex Pin
SledgeHammer0113-Mar-13 9:33
SledgeHammer0113-Mar-13 9:33 

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.