C# :: Creating X Number Of Textboxes At Runtime And Manipulate

May 6, 2014

i need to creat a program in la user give me "X" number and creat the textbox and y need sum all textbox

int t = Int32.Parse(txtbano.Text);
for (int i = 0; i < t; i++)
{

[Code]....

View 8 Replies


ADVERTISEMENT

C++ :: Manipulate Image File At Runtime

Oct 20, 2013

I've come to a point where I want to manipulate an image file at run time or with pre-determine sizes and have to be applied when the windows is moved or through in program options.

I know I can do the applying part. However I am a little unsure of how to tackle the image manipulation. I want to make it so that it is not os dependant. So I know I can not rely on any os functions. The only other thought that came to mind was to deal with the video card itself.

So the main question after all of that is said and done. How is c++ able to interact with the video card directly for images? Or if there are existing function I can use. How do they do that? If I can use existing function I would like to be able to manipulate it myself.

View 4 Replies View Related

C/C++ :: Creating Constant At Runtime With User Entered Value?

Aug 14, 2014

At the moment I am making program that will use a 2d selection of "cells" to make a "map" of sorts. However, the size will not be known until run time.

I figured using an array would good, because once the size is chosen it won't be changed. However I can't create an array without using a constant.

So the first question is, can I create a constant at run-time with a user entered value that can then be used for an array size? If so, how?

Otherwise, what are my options to achieve this? I know vectors can be used, but A, my compiler keeps giving me problems even when C&P some code bits (yes I even remembered to #include and such) and B, I noticed that vectors reserve extra memory for when the size changes but this is bad (well my dinky little program won't notice, but trying to set good habits as I learn, so I'm keeping it in mind) as I don't need and don't want to allow the size to change after creation.

Which leads to number three, if I do have to use vectors, how can I prevent any accidental size changes after the initial size is determined?

View 4 Replies View Related

C++ :: Creating Variable On Runtime - Message Decoding

Apr 10, 2013

I receive messages over a bus. Suppose there is a function to read the messages storing them into a struct defined as follows:

typedef struct
{
ULONG timestamp;
BYTE ID;
BYTE data_length;
BYTE data[8];
} MSG_FRAME;

Depending on the message ID different messages represent different values for one project.For example msg with ID 10 can include in the 8 bytes something like:

width: 6 bits
height: 6 bits
actpos: 12 bits
maxpos: 12 bits
minpos: 12 bits
range: 16 bits
total: 64 bits = 8 bytes

Printing the message is no big deal. But here comes the tricky part. I want to print out the specific information hidden in the 8 bytes. I can define the structures for every msg ID and compile the program with this "special" header file, but I want to do it during runtime of the program, loading the information regarding the msgs, because i can have different projects where the information for different msg IDs can differ.

I've a non-C file, where basically all the information is written. Lets stay frame named

GetStatus{
bit 0 - 7 width
bit 8 - 15 height
.
.
}
etc.

How to read it on runtime and decode the messages? On runtime I'm not able to create variables and structures anymore!

View 13 Replies View Related

C++ :: Input Number During Runtime - variable Array Length

Nov 28, 2013

I want to ask for a number as an input during runtime and then create an 2-dimensional array of size as specified by user. i.e. if the user inputs 3, the array should be of size 3X3, and likewise...

View 9 Replies View Related

C :: How To Manipulate Binary

Oct 5, 2013

My assignment is to write a binary calculator that works with floating point for simple math (+,-,x,/). How to do this. the binary numbers need to be from the user.

View 2 Replies View Related

C++ :: Creating A Random Number Generator?

Mar 5, 2014

How would I go about creating a random number generator (or pseduorandom I suppose) with user inputted lower and upper bounds along with a user inputted size of the sequence (so they can select how many random numbers they'd like outputted)?

View 3 Replies View Related

C++ :: Creating A Random Number Generator?

Jul 13, 2014

I am creating a random number generator and have run into a problem with my do while loop. it continually prints one of the lines of output infinitely. what am i missing here?

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
unsigned seed = time(0);

[code]...

View 7 Replies View Related

C :: Creating Struct Which Represents Complex Number

Feb 26, 2015

1 create a struct called complex which reprensts a complex number . both the real and imaginary compoents should be represented as doubles . ( 1 marks) .

2 write down a function called magnitude which has one parameter ( a struc complex) and a return type of double . it should return the maginude of the given parameter . ( 3marks) .

3 write a function called find_largest which has two parameter (one of type struct complex const * and the other type int) and a return type of struc complex . the two parameter represent an array of complex numbers and number of elements in that array . the function should return elements from array which has largest magnitude . this fucntion must called the magnitude function . ( 5 marks)

4 write a main function . your main fucntion . Your main fucntion should repeately prompt the user for complex number , storing them in an array. you should continuing reading in complex number until the user enters in both componets , at this point you should stop . you should not make an assumptions how many complex number the user will enter , ( i.e use realloc) after reading in complex numbers from the user you should print out real and imaginary components of the complex number with the largest magnitude.

Code:

#include<stdio.h>
struct complex {
double real;
double imag;

[code]....

View 5 Replies View Related

C++ :: Creating A Random Number Generator Program?

Aug 9, 2012

I'm trying to create a program that creates random numbers. I looked through some examples and this is what I came up with. The time identifier seems to be undefined yet I see no reason it is undefined.

Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() {
//Re-seed the random-number generator
time_t now;

[code]...

here's my error code..

1>------ Build started: Project: bake, Configuration: Debug Win32 ------
1> bake.cpp
1>c:usersjonbecherdocumentsvisual studio 2012projectsakeakeake.cpp(8): error C3861: 'time': identifier not found
1>c:usersjonbecherdocumentsvisual studio 2012projectsakeakeake.cpp(9): warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

View 2 Replies View Related

C++ :: Manipulate A String Into Name Of A Variable?

Feb 1, 2013

The while loop is increased by i++ each time. In the commented line I want to express.When:

i = 1 , player1.cards[j] = random;
i = 2 , player2.cards[j] = random;
void cardScramble()
{
int random;
int i = 1;
while (i <= 4)

[code]....

I tried to define it or manipulate it as a string but didn't work.

View 2 Replies View Related

C++ :: Creating Script That Can Rotate Image Through Some Number Of Degrees

Dec 3, 2014

Create a script that lets you rotate an image through some number of degrees(out of a maximum of 360 degrees). The script should let you specify that you want to spin the image continuously. It should let you adjust the spin speed dynamically.

<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<title>Final</title>
</head>
<body>
<canvas id = "drawRectangle" width = "200" height = "200"
style = "border: 5px solid black;">
</canvas>

[code]....

View 2 Replies View Related

C++ :: Creating Recursive Function That Will Print Out A Number To A Power

Apr 9, 2013

I am trying to create a recursive function that i can call on in order to take a user inputed base and exponent and give final answer this is what i have but im completely lost after this i dont even know how to continue. What i have so far

#include <iostream>
using namespace std;
int Exp(int x,int y){
if(base <= 1 || exp == 0) return 1;
if(exp == 1) return base;
int main(){
int number, exp;

[Code] .....

After i set the base situations im not sure how to get the function to make the function take the base to the exponent recursively.

View 3 Replies View Related

C++ :: How To Manipulate Certain Strings - Ignoring Spaces

Aug 11, 2013

How I can manipulate certain strings. This program here is supposed to randomly scramble any word/sentence input. However, I notice that even the empty spaces get moved; is there any way to stop that from happening? I would want the empty spaces to stay in their input positions.

#include <iostream>
#include <string.h>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include <string>
using namespace std;

[Code] ....

View 4 Replies View Related

C++ :: How To Manipulate Bits Of All Types For Storing

Aug 10, 2013

I need a translate (in both directions) all primitive types, into char[] (will be stored in string)

I understand how to manipulate integral types with bits and I cant just cut them down and shift them, but float and double don't work with this manipulation. So, how I can create a perfect bit copy of float and double?

int i = 0xFCED03A4; //Random number
char c[4];
c[0] = ((i >> 3) & 0xFF);
c[1] = ((i >> 2) & 0xFF);
c[2] = ((i >> 1) & 0xFF);
c[1] = (i & 0xFF);

[Code]...

This is basic stuff but I need an equivalent for float and double types, and it needs to be a perfect BIT copy, not value copy.

View 7 Replies View Related

C++ :: How To Manipulate A Whole Array As A Single Integer

Mar 22, 2014

here i have an assignment, creating a longInt class and using it to calculate large numbers, i dont have a clue how to manipulate a whole array as a single ineteger.

View 7 Replies View Related

C# :: How To Use Datagridview With Textboxes Or Labels

Jul 16, 2014

How you can touch a datagridview and it would insert the name it has for a product into a label or textbox.... As I have looked all over and I can't really find a proper way it is mentioned or maybe I am not applying it correctly.

View 4 Replies View Related

C# :: Creating Complex Number Calculator - Convert String To Ints

Sep 18, 2012

I am working on an assignment to create a Complex number calculator. In this assignment I am to ask the user for input to the calculator. We are given a sample run output that looks like this.

Enter operand1: 3 4
operand1: (3, 4)
Enter operation : +
Enter operand2: 1 2
(3, 4) + (1, 2) = (4, 6)

My question is how would I take from the user: an integer followed by a space followed by another integer and convert that into two seperate accessible int values that I can save as real and imaginary values.

View 4 Replies View Related

C++ :: Creating User Defined Function To Count Number Of Vowels

Oct 7, 2013

The output I'm getting here just counts every letter in the sentence and counts them as vowels. I'm trying to make the user defined function return the amount of vowels within the sentence.

#include <iostream>
#include <iomanip>
#include <cmath>

[Code].....

View 4 Replies View Related

C :: Program To Manipulate Doubly Linked List

Nov 17, 2013

I'm trying to write a program that manipulates a doubly linked list. My professor wants it to have two structs, one called Node (containing the data, and pointers to the next and previous nodes) and one called DLList, which contains the nodes for the head and tail (which is then passed to all of my functions).

I'm a little confused how to access the head and tail, for instance, if I want to initially set them to null in the main function (he emphasized the need for this), or to use them in my functions. I've tried a lot of variations to call the head and tail, but I keep getting told that head and tail are undeclared in the function.

How might I access my head and tail, for instance in a main function, when they're defined like this? (I took out all of the logic in my functions for clarity)

View 1 Replies View Related

C++ :: Importing 2D Array - Print Out Matrix And Manipulate It

Nov 9, 2014

Essentially what I need to do is take a text file, ("input.txt"):

4 4
1 0 0 1
1 1 1 1
0 0 1 0
0 0 1 0

And take the first two values on line 1 (4, 4) and use them as length and width.
Number of rows: 4
Number of columns: 4

Then I need to print out the matrix and further manipulate it. I need to find the sum of the 1's per column and then take that number and replace each 1 with the 1's in each column.

So it'll look like this:
2 0 0 2
2 1 3 2
0 0 3 0
0 0 3 0

The part that's mostly troubling me is that my instructor will be giving me the input file with random values, so I don't know what the matrix dimensions will be.

I can read the 2D array but can't seem to use it after. I need to find a way to skip the first line, and then read in the matrix and be able to use it mathematically to add up each column.

View 1 Replies View Related

C++ :: Function To Manipulate Data From A List Class

Feb 3, 2013

I made a program that can use a function to manipulate data from a list class. The program is very basic and I think the error makers may be obvious to some of you. I just wanted to find it without having to scrap my program. It doesn't generate a compile error but it announces a memory error while it is running. I use visual studio 2012, the program is an exercise from a c++ book.

list.h
#ifndef LIST_H_
#define LIST_H_
typedef double Item;
const int MAX = 10;
class List

[Code] .....

View 4 Replies View Related

C++ :: Manipulate Array Of Student Record Objects

May 15, 2014

Create an application to manipulate an array of student record objects. A student record will consist of a name (first, middle, and last), an ID number (9 numeric digits, cannot be more or less), an address (street, city, state, and 5 digit Zip code), and a phone number (3 digit area code and 7 digit number). The application will support an array of students. The user will be allowed to enter records from the keyboard, sort records by either name (last, first, middle) or by ID, save the records to a disk file (name supplied by user), and read the records from a disk file (name again supplied by user).

Create a fixed length string that must check that the length of the string is the required length. The fixed length class should be done as a template with the number of characters as the template argument. From this fixed length string, derive a class to hold digits of a fixed length.

Create component classes as necessary to use together to implement the student record class.

Use either the array template created in an earlier lab to handle the array or you may use the vector class from the STL to handle the array of student record objects.

The maximum number of students will be 25 (it may be less).

View 1 Replies View Related

C# :: Transferring Data To Textboxes From Database?

Feb 22, 2015

I can not do transferring data to textboxes from database.

="c#">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;
using MySql.Data.MySqlClient;
namespace WindowsFormsApplication1{

[code]....

I got the error this line:

read = cmd.ExecuteReader();

View 3 Replies View Related

C# :: How To Populate HTML TextBoxes With SQL Results

Mar 9, 2015

I have an HTML5 form with a number of text boxes on it. I would like these textboxes populating with data retreived from an SQL database, using inline C#. I have a stored procedure that returns the data.

View 8 Replies View Related

C# :: Sudoku Solver Using Loops / Textboxes

Apr 28, 2014

As it is known there are nine boxes and in each box we can put numbers 1-9 without repetition. I am trying to check a given filled Sudoku puzzle whether appropriate numbers are inserted in each of the nine boxes. For the time being I don't consider row repetition and column repetition. I wrote the code using loops and condition

I used 9*9 text-boxes. The names of the textboxes is sequential like for example for the first box
txt11,txt12,txt13
txt14,txt15,txt16
txt17,txt18,txt19

Actually, I used also the controls id to access the text boxes, and each box is checking with the neighboring boxes for equality both in forward -> and backward <-

image

So here is the code

public void BoxCheck() {
int start = 82, end = 74;
int i, b, f;
for (int p = 1; p <= 9; p++, start -= 9, end -= 9) {
richTextBox1.AppendText("Box " + 1);

[Code] ....

This works pretty fine, but is is the right way to do it? it is efficient? Remember for a full checking I have to include row check and column check as well, this is just for checking within each of the 9 boxes in Sudoku.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved