C# :: Option Selection Box To Change What Appears In Main Window Screen

Sep 17, 2014

Basically i have a 'HomeWindow' with a button 'OptionWindow'. My idea is that the 'OptionWindow' button will open up the 'OptionWindow'. Which will give the user three options 'Option1', 'Option2' and 'Option3'. If they pick 'Option1' then in the 'HomeWindow' in a stackpanel i want it to display 'UserControl1'. Where as if they pick 'Option2' then in the 'HomeWindow' in a stackpanel i want it to display 'UserControl2'.

If you need some of my code that i have already then let me know what you need as i have a lot of it so can't paste it all in one go. But the new thing i need is the way of making the user-controls in the 'HomeWindow' change depending on what is selected in the 'OptionWindow'.

View 14 Replies


ADVERTISEMENT

C/C++ :: Menu Selection Does Not Continue To Desired Screen

Mar 8, 2014

Basically we have to create a system for loan amortization for vehicle company. The code is still in its development stage and I am having problems with one of the menu selections. all the other menu selections work fine except for menu selection 3. I'm quite stuck on it. When I run the program everything goes well except when I enter 3 at the main menu, it just exits the program instead of going to the screen for the menu selection.

#include<stdio.h>
#include<conio.h>
#include<string.h>
main() {
char un, /*username*/
name, /*customer name*/

[Code] ....

View 1 Replies View Related

C# :: User Control Being Blank On Main Window

Jan 5, 2015

I have followed the tutorial here - [URL] .....

This is a tutorial that I have gone through completely with success, but now I am trying to create a different project using the same sort of setup.

When I add my usercontrol to the MainWindow it has none of the buttons/TextBlocks on which I have put on the UserControls - It is just a blank box. What could be causing this?

I have changed the name of the project to [snip] because it has a company name in it...

"NumericControl.xaml"
<UserControl x:Class="[snip].UserControl.View.NumericControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

[Code] ....

View 14 Replies View Related

C/C++ :: How To Change CMD Window Size (No Properties)

Oct 23, 2014

Is there any way to resize the cmd window?

Kinda like in properties, where you choose the height and width of the window, but in actual code. So everybody who open my program see the same window.

View 1 Replies View Related

C/C++ :: Make Basic Snake Game Using Command Window And Screen Refreshes?

Apr 15, 2015

I am trying to make a basic Snake game using the command window and screen refreshes. So far I have a board, snake, food, and no walls. Basically I have it so the snake moves like the traditional snake in the game, when it eats the food once it grows. However when it eats the food a second time the game crashes. I think I have narrowed the issue down to the grow array that I have (below) but I am not sure if the issue could be a result of something else.

Grow Array

cord growArray (cord *p_values, int *size)
{
*size = *size + 1;
cord *p_new_values = new cord[ *size ];

[Code]....

View 7 Replies View Related

Managed C++ And C++/CLI :: App That Shows Pixelated Picture In Window - Reference Image On Screen?

Jan 11, 2014

I am developing an app that shows a pixelated picture in a window. I am trying to capture the image, which is composed of a number of tiles processed from a mother image, but I am having difficulty since I can't reference the image on the screen. I have placed a rectangle around the image and my understanding is that I have get the window handle for the rectangle in order to save the Image as a jpg file. In the literature there is something about a Device Context and a window handle but my compiler throws out HWND and I don't really understand the device context. I am using Windows Forms, not native code.

View 6 Replies View Related

C/C++ :: How To Change Position Of Image And Button On Window

Jan 12, 2015

The question says:

Place an Image on top of a Button. Move both when the Button is pushed.

Please have a look at this code:

#include <GUI.h>
using namespace Graph_lib;
//------------------------------------------------
class rotation : public Window {
public:
rotation(Point xy, int w, int h, const string& title):
Window(xy,w,h,title),
[Code] ....

The problem is that, it is not possible to define an Image in public/private part of the class rotation. Image needs all arguments to be supplied even when declaring one. (Image is here in Graph.h)

And if I define that Image in the body of main() function, so how to provide access for void rotate() to change its position with the position of button simultaneously.

View 6 Replies View Related

Visual C++ :: How To Detect If Window Media Player Is Running In Full Screen Mode

Jan 21, 2013

How can I check if window media player is running in full screen mode & topmost in c++ MFC?

What I used is this logic:

I compared media player full screen coordinates to that of monitor coordinates.If they are same implies media player is in fullscreen.But it has one flaw.Whenever there are control(for play,pause) displayed in full screen in media player, coordinates are not coming same as that of monitor.

View 10 Replies View Related

Visual C++ :: Disable Controls And Change Window Size

Jun 6, 2013

I have created an exam environment for our schools, it comprises of 3 files; a .kix file that says if they are in the examination group run a .vbs file. The .vbs file kills the explorer.exe task so they don't have any taskbar or desktop shortcuts and then opens a .hta file.

The .hta file is a user interface that has icons for apps like Win Word that executes the application when you click on it. There is also a log off button.

Looking for some code that stops the students from being able to close, minimise and resize the window. Looking for code that can lock this down so they literally can't do anything except click the icons inside the window.

View 3 Replies View Related

C++ :: Possible To Change Value Of Variable In Main Using A Function?

Jan 30, 2014

I'm currently writing a poker game and am trying my best to avoid using global variables. I have a few variables in int main() which i was hoping to use to store the value of each players hand. I then created a function which calculates the value of the hand but cannot get this value back into the main function.

For example:

Code:
#include <iostream>
using namespace std;
void getValue(int value) {
value = 4;

[Code] ....

Is there any way i can get the value of value using this function? If not what can I do?

View 8 Replies View Related

C++ :: Clear Screen In Console - Change Text Color In EXE

Dec 28, 2013

How I can clear the whole screen in console...

And I'm using clrscr(); and its not working.

How i can change the text color in the .exe without using system function

View 4 Replies View Related

Visual C++ :: Change Frame Window Size According To Increase In Font Size

Nov 27, 2012

Change the frame window size according to font size increases.

View 3 Replies View Related

C++ :: Selection Process Using Roulette Wheel Selection?

Feb 9, 2013

I'm trying to make a selection process using roulette wheel selection. To do this I created two matrix, one random probabilities and one increasing probabilities. The idea is to choose a number according to the random probabilities. Here is the code I've written.

#include <iostream>
#include <conio.h>
#include <cstdlib>
using namespace std;
int main (){
float select [5], prob [10], mat [5];
int c, r, z;
cout.precision (2);
cout << "Random Number:" << endl;

[Code]...

The result I got is as follows:

Random Number:

0.0013 0.56 0.19 0.81 0.59

Increasing Probabilities:

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Selected Column:
0
5
6
8
9

The evaluation doesnt seem to start from c=0 again. The selected column should be 0, 5, 1, 8, 5.

View 6 Replies View Related

C/C++ :: Thread Appears To Run After SetEvent

Apr 28, 2014

I don't know if I've setup the thread correctly or not, but its behavoir isn't what I'd expect. I'm creating the thread within a BN_CLICKED message

typedef struct my_TNFO {
    HANDLE h_event;
    HANDLE h_thread;
    DWORD  thread_id;
    BOOL   running;
    BOOL   init;
    BOOL   canceled;

[Code] ....

progd->count was devised to stop the thread when the recursion ended by posting a message to the main window. When it reaches 1, the def procedure sends the WMU_DISC_DONE message to set the event

All that *appears* to work; however, if I cancel the recursion thread, the list view continues to populate for a bit and then deletels all but 1 item though I send the message LVM_DELETEALLITEMS.

If I move the (tmp->canceled == TRUE) test inside of the do-while, the app gets loopy.

View 4 Replies View Related

C/C++ :: Scan Through One String To Find A Letter That Also Appears In Another?

Feb 3, 2015

I need a code that will search through string 1 and find the first place with a letter that also appears in string 2 and return the pointer of that place. This is what I wrote:

char strPbrk(const char *s1, const char *s2) {
char p = *s1;
for (int i = 0; i < strlen(s1); i++)
for (int j = 0; j < strlen(s2); j++)
if ((p+i) == *(s2+j))
return p;
return NULL;
}

but it continues to return wrong values idk what I'm doing wrong.

View 4 Replies View Related

C/C++ :: Binary Tree - Count How Often Character (e) Appears In It

Feb 5, 2015

I have a binary Tree and I have to count how often the character 'e' appears in it. Then I have to print it Inorder.

My code:

#include<stdio.h>
#include<stdlib.h>
struct node {
struct node *left;
struct node *right;
char chr;

[Code] ....

But I always get the Error Message "expected ';' ',' '.' or ')' befor numeric constant in this line:

struct node *mkNode(char chr, struct node *1, struct node *r)

View 1 Replies View Related

C :: Number 1 Appears In Next Line Every Time On Typing A Character

May 17, 2014

Everytime I type a character, the number 1 appears in the next line. And i just keep getting the message "Wrong! I have more than that." even when I type a number bigger than 1023

Code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void) {
srand(time(NULL));

[Code] ....

View 10 Replies View Related

C/C++ :: Dice Rolling - Keeping Track Of How Many Times A Number Appears?

Sep 27, 2014

I wrote a code that mimics a dice, my code so far will ask for the user to input a number at which they want to hold or no longer throw the dice, it will also ask the user how many roll simulations they would like to do.

If a 1 is rolled the turn is over and the score is 0

After this input is recieved the code goes into a loop until the values have been met.

I would to add probability to my code so I need to know how many times a certain number was rolled and this is where I am stuck.

An example of how I would like my code to work, let's suppose hold at number is 17

We role the dice until we roll a 17 or larger, but if we roll a 1, then our score is 0.

Let's suppose the number of simulations is 5 and for simulation 1 we roll

2 + 5 + 6 + 4 = 17

and for simulation 2 we roll

5 + 4 + 1, but since we rolled a 1, the score is 0,

for simulation 3 we roll

3 + 4 + 5 + 6 = 18

for simulation 4 we roll

4 + 4 + 6 + 6 = 20

for simulation 5 we roll

3 + 4 + 5 + 5 = 17 so that means we got

0: 1 time 1/5 = .20
17: 2 times 2/5 = .40
18: 1 time 1/5 = .20
19: 0 times 0/5 = .00
20: 1 time 1/5 = .20
21: 0 times 0/5 = .00
22: 0 times 0/5 = .00

In other words the idea is to roll a 17 or larger (or whatever the hold number happens to be), but if you roll a 1, then your score is a 0.

#include <iostream>
#include <cstdlib>
#include <ctime>
using std::cout;
using std::cin;
using std::endl;
int dieRoll();

[Code] ....

View 4 Replies View Related

C++ :: Count How Many Times Each Word Appears - Empty Output Array File

Sep 20, 2014

I am writing this program that is supposed to read a file, put the data into an array, alphabetize, count how many times each word appears and print to an output function. I posted before on how my program had an error when I ran it but I have fixed that. Now my outputArray file is empty. It gets created but there's nothing in it.

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

using namespace std;
//global to this file

[Code] .....

View 3 Replies View Related

C++ :: How To Add A Select Option

May 27, 2013

I just started on a project on c++ and I was wondering if it is possible to add a select option (where the c++ program requires the user to select an option) . I couldn't find this anywhere.

View 3 Replies View Related

C++ :: Getting Unhandled Exception When Try To Run Option 3

Sep 9, 2012

I'm getting Unhandled exception when try to run option 3.

This my code below.

Code:
#include <iostream>
#include <string>
using namespace std;
struct Vet {
string name;
int numOfAnimals;
string phoneNum;

[code]....

View 8 Replies View Related

C :: Y / N Option To Continue - Compiler Does Not Read It As A Loop

Jul 30, 2013

I've been having problems with my loop that asks if the user wishes to continue or not. The required input should either be 'y' or 'Y', or 'n' or 'N'. Anything else should be counted as invalid, and repeat the prompt for input. The first few times I ran my program, the compiler does not read it as a loop. The next few times just won't work properly.

Here is the prompt:
Code:
void question() {
char option;
printf("
Do you want to continue? {Y|N) ");
scanf("%c", &option);

[Code] ......

As it is, it immediately runs the else option, but otherwise runs just fine. I suspect it could be because I have not specified a size for the option variable, but I try doing that, and the prompt relegates everything to the else.

(And also, here's the rest of the code. Basically, it just assigns a value to the letters of the word (a/A = 1, b/B = 2, etc.), adds these values, and determines if a word is prime or not based on the sum.)

Code:
#include <stdio.h>
#include <string.h>
#define size 30
int main() {
char letter, word[size], lower, upper, option;
int i, value, ans = 0, a, choice = 1;

[Code] .....

View 4 Replies View Related

C++ :: Coin / Money Change Code Doesn't Give Exact Change

Feb 20, 2013

My coin/money change code works when there can be an exact change each time, i.e. when the 1 cent option is available. However, when the change options are only $10, $5, $1, 25 cents and 10 cents, it does not give me what I want for instance, I wanted to get change for $237.80, I was expecting to get:

23 10's, one 5, two 1's and 8 dimes. However, the code below is giving me 23 10's, one 5, two 1's and 3 quarters (there is no option left for the 5 remaining cents).how to fix it?

Code:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
void change(double cents, int a[]);
int main() {
double Dollars;
double cents;

[code]...

View 14 Replies View Related

C :: Menu For A Project That Takes String Input And Does Whatever Option Specified

Feb 13, 2014

I have a menu for a project that takes a string input and does whatever option you specify. It works perfectly EXCEPT when it goes through the while-loop (while you didn't say quit the menu reloads). It will spew out all the text in the menu like a bulimic teenager. Then it reloads properly and asks you for an input like nothing happened. While this is not a fatal error (code still functions)...

Code:
#include <stdio.h>
#include <math.h>
#include <string.h>

double aa=0, ab=0, ac=0, sa=0, sb=0, sc=0;
char a1[13], o1[]="AAS

[Code] .....

View 2 Replies View Related

C++ :: Option To Display All Items Have Entered In Alphabetic Order

Jan 14, 2014

i need one more option which it can display all the items i have entered in alphabetic order in my program..this is my coding......

#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define capacity 1000
void cal_item(struct item[capacity]);
void input(struct item[capacity]);
}

[code]....

View 1 Replies View Related

C++ :: Rock Paper Scissors Game - How To Add Play Again Option

Apr 1, 2014

So , i had to make an rock paper scissors game . After lot of hard work and struggle ,I completed it but my professor rejected it since I didnot add option where it says "Would you like to play again .Y/N " . The code has too many brackets ! Here is my code

#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

// for displaying the outputs to the user; passing string to functions
void user_win() {

[Code] ....

View 1 Replies View Related







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