I know nothing about windows scripting, but hopefully someone can point me in the right direction. I need to open a browser on a keypress, and then close the browser after the keyboard/mouse have been inactive for 1 minute or so. After the browser closes, I need to switch back to the application that was minimized when the browser was opened. The broswer will be google chrome if that makes a difference.

Is this feasible to do? Any tips on where to startRunning windows 7.

Thanks.

Hey guys,
I am working on an application for my school and work. I work for the It team that maintains and checks the AV equipment we have around campus and solve the problems associated with them. We usually just mark them down with pen and paper etc. Im trying to bring us into the digital age using this program.

Basically, THe main form displays the data from the database. the second form that pops up when you click the check rooms button is a form for filling out which rooms you have checked and then submits them to the separate issues database maintained by the whole campus IT division(i have no control over that and cant access the data, the only way im able to add to it is to send an email to the server and it automatically updates it based on the format of the email) Submitting it to the huge IT database works fine, but i want to also update some of the fields in the smaller database I have created using the input from the second form(the one the datagridview is connected to on the first form)

My problem is I have no idea how to use any sort of queries and what not and have no database experience.

Here is the main form
snip1

Here is the second form
snip2

Basically, what I want to do is get some of the information from the second form(the date for example)
into the date ...

do i need to make it a global variable of sorts in the row class or something??

i mean i create the new row object when i press the button, and creating the row object is what puts all the new combo boxes on the form, so i should be able to reference those comboBoxes using row.whateverComboBox right???

but why cant I reference the variables of my new row object
I havent done much with programming so im sure its a scope issue but I cant figure out why
I need to refernce the variables of the row object from within my event code for

ok so I now under my button event I have this

 row.buildingComboBox.SelectedIndexChanged += new EventHandler(buildingComboBox_SelectedIndexChanged);

and my event code is this:

        private void buildingComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {

      roomComboBox.Items.Clear();
        if (this.buildingComboBox.SelectedItem.Equals("ATLC"))
        {
            foreach (int x in ATLC)
            {
                this.roomComboBox.Items.Add(x);
            }
        }

    }

My problem now is it will not let me reference buildingComboBox or roomComboBox even though they exist on the form after the button is clicked

I am having trouble figuring out how to handle events for components that are created when I click a button.

I have a class called rows which is used to create a row of components (combo boxes) . I have a button on my form that has an event to create a new rows object. I would like to have events for the newly created combo boxes but I dont know how or where to put them.

Here is my form code:

private void button1_Click(object sender, EventArgs e)
    {
        rowClass row = new rowClass(startingBuildingComboBoxX, startingRoomComboBoxX, startingProblemsTextBoxX, startingNotesTextBoxX, startingY + 30);
        startingY = startingY + 30;
        this.Controls.Add(row.buildingComboBox);
        this.Controls.Add(row.roomComboBox);
        this.Controls.Add(row.problemsTextBox);
        this.Controls.Add(row.notesTextBox);
        button1.Location = new Point(411, buttonY);
        buttonY = buttonY + 30;
        this.Height += 30;

    }

so whenever I push the button it creates a row of components and also moves the button down to the next row.

I would like to add events for those components that were created in that rows object. But how do I do that??

this is my code for that event:

     public void buildingComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {

        this.roomComboBox.Items.Clear();
        if (this.buildingComboBox.SelectedItem.Equals("ATLC"))
        {
            foreach (int x in ATLC)
            {
                this.roomComboBox.Items.Add(x);
            }
        }

    }

I just dont know where it belongs, or how to tell the form to use it etc.

Hey guys, pretty new to c# and have a few questions about this program im trying to write

I have a row of a combo box followed by a text box followed by a combo box followed by a text box.
They are all sitting in a nice little row and next to that row I have a button that I want to be used for adding a new row. THen I want that button to move down to the next row and i want the process to be able to be repeated as many times as the user wants.

My question is

What is the way to approach this?
I know I could write an event for the button and add more components as many times as i need but that is way to much code. How can I simplify it??

Some code examples would be nice

Thanks.
Stone

nevermind, i found another module. here is what i ended up with and it works just dandy

from win32clipboard import *
import os

os.chdir('some_path')
with open('some_file', 'r') as text_file:
   text = text_file.readline()
OpenClipboard()
EmptyClipboard()
SetClipBoardText(text)
CloseClipBoard

pyTony could you explain how to use the methods in that clipboard module? i just started programming and am not really sure how to use those. I understand what the methods do, but im not sure how to implement them

that works too, I didnt think of that! thanks

im trying to write a program that will read a line of text from a file and then print that text into whereever the cursor is in the browser. like into the address bar or something. is the possible with python? how would i go about doing it. i know how to read from a file but how would i get that input into the browser window

ok so it just autmatically reads line by line

im following along in this nifty little book and one of the coding examples just sparked my interest.

data = open('some_file.txt')
for each_line in data:
    print(each_line)

How does python know what i want it to do without really telling it?
i figured i would have to tell it how i wanted it to print the lines, like parse through each line of the file or something. But it just prints out each line. Like it knew that when i called my variable each_line it understood
so what am i missing? am i over thinking this?

oh ok. well why does windows display the file paths using back slashes

no that doesnt work either, the C: produces an error as well, a unicode error. Its the colon that throws it off it seems

Hey Guys, i just started learning python and havent really done much programming so im pretty new

im following a book and I have to read some data from a text file

the code thats giving me trouble is

os.chdir('Users\spreston\Desktop\HeadFirst\Chapter 3')

the error says that the path does not exist, but i know it does, which leads me to believe i typed the path in wrong, any suggestions?

ive been trying to get slick2d installed properly on my mac, im using netbeans and followed a tutorial found here [url]http://thejavablog.wordpress.com/2008/06/08/using-slick-2d-to-write-a-game/[/url]
but something goes wrong when i compile. i think it has to be a pathing issue but cant figure it out

wow dhruv no need to be a dick.

[CODE]
import javax.swing.*;

import java.awt.event.*;
public class second extends JFrame implements ActionListener {

    JButton button;
    JFrame frame;

    public second() {

        setLayout(null);
        setSize(500,500);

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         button = new JButton("click me");

        button.setBounds(90,300,50,50);
        button.addActionListener(this);
        add(button);

    }
        public void actionPerformed(ActionEvent e) {
            if(e.getSource() == button){
                                frame = new JFrame();
                frame.setSize(500,500);
                                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                                    frame.setVisible(true);

            }
        }

    }

[/CODE]

create an object of the second class in a main and call the objectreference.setVisible(true) method and voila

fyi the second frame is the same size as the first but if you move it its there

thanks man, that will really help a ton.

hai, i was wondering if you guys had any advice on getting into game programming with c++
i have a pretty basic understanding of the language and was trying to find out how to do this kind of stuff
but so far i havnt been able to find out much. im just looking for someone to point me in the right direction(tell me what stuff i need besides just a compiler etc) and how to use it

thanks:)

i understand now that it is actually generating 500 shapes, there just in the same spot every time. How do i randomize that which is already random?

How do i randomize the
g.drawRect(random args here?);

[QUOTE=Ezzaral;1043206]Sounds like you just need to tweak your coordinate math a little. If you got a solid triangle you are on the right track.

Edit: Oops, cross posted with santiagozky. I would agree that you should add more than if you don't want solids.[/QUOTE]

haha thanks everyone. got it all done yesterday in class. went very well. thanks for your help =), couldnt have figured it out without ya

hi, i have a lab monday which requires me to generate random sized squares random poinst. im not to familiar with the random class and the syntax and all that but im guessin i need to use a for loop.
if someone can just point me in the right direction on what to do before the loop that would be nice. i will try and figure more out on my own while i wait for responses

so far i have this. but when i run it it only does one square. i want it to do many squares at once.

[CODE]
import javax.swing.;
import java.awt.
;
import java.util.*;

public class randomSquares{
public static void main(String[] args) {
randomSquares d = new randomSquares();
}

public randomSquares(){
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new MyComponent());
frame.setSize(500,500);
frame.setVisible(true);
}

public class MyComponent extends JComponent{
public void paint(Graphics g){
int height = 500;
int width = 500;

Random r = new Random();
int number = r.nextInt();

int random_number = number % 500; {
if (random_number < 1) random_number = random_number + 500;
System.out.println(random_number);

for (int i = 0; i < 500; i++);{
    g.drawRect(random_number, random_number, random_number, random_number);
}

}

}

}
}
[/CODE]

yeah this is what i would like to do.
i started out fixing 2 of the coordinates since they dont need to change
then just looped adding or subtracting from the two remaining coords. when i did this all i got was a big black triangle where the lines and the curve should be. i dont know if the way i wanted to do it just wont work or my syntax is wrong.

im trying to make my program draw lines from the top right corner of the JFrame which is 400 x 400, to the bottom of it making what looks like a curve but really is just lines. i think i know the basic idea of how to do this which would be to subtract 1 from x and add 1 to y and loop that in a for loop. i just cant get my syntax right or sumthin (im a first year java student) so far i have (and i dont really understand these code tag things so forgive me)

import javax.swing.;
import java.awt.
;

public class DrawingColor{
public static void main(String[] args) {
DrawingColor d = new DrawingColor();
}

public DrawingColor(){
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new MyComponent());
frame.setSize(400,400);
frame.setVisible(true);
}

public class MyComponent extends JComponent{
public void paint(Graphics g){
int height = 200;
int width = 120;

    // and here is where my loop would start

}

}
}

i know how to draw 2D shapes just fine
but how would i draw 3D ones? if thats even possible.
please help,
thanks =)

thanks =)

is there one of these? plz help