C# :: Matrix Of Buttons Variables?
Jun 14, 2014
There is a genereted matrix of buttons:
private void Single_Load(object sender, EventArgs e) {
//code here
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
//a lot of working code here
b[i, j].Click += new System.EventHandler(ClickButton);
}
}
}
What can I do when one of those buttons is pressed (i have the method ClickButton) to know what i and j has he?
I want to make something like this
ClickButton() {
if (x%2==0)
v[i, j] = x; //i and j should be form the matrix of buttons
}
View 9 Replies
ADVERTISEMENT
Apr 21, 2014
Say I made a vector matrix:
vector<vector<int> > matrix;
and the matrix look likes this:
0,0
0,1
0,2
...
How would I make it get a random piece of this matrix? So for example, how would I get it to access a set of variables like 1,3 like as if it was just an array with stored data in it?
View 3 Replies
View Related
Mar 27, 2013
i want to know how i can solve this question? do i need to create a class or write the program codes.
View 12 Replies
View Related
Jun 1, 2014
I just want to know the code of the program: Write code to accept matrix as aurgument and display its multiplication matrix which return its multiplication matrix.
View 1 Replies
View Related
May 5, 2014
Basically I am creating a game and I need the ai to look for specific buttons. At the moment this is the code I have, and what it does is it makes the ai look for any random button that has't already been clicked.
Code:
private Button look_for_spaces() {
Console.WriteLine("Looking for spaces");
Button b = null;
foreach (Control c in Controls) {
b = c as Button; // performs a cast
[Code] .....
Now what I'm trying to do is make the ai go through 4 searches in steps instead of looking for any button. I want it first to look for buttons 1, 2 and 3, if there's a space in any then it will be clicked but if all of them are already clicked it will look for spaces in buttons 4, 5 and 6 and so on if that makes sense. But i'm not too sure how I would do it.
View 3 Replies
View Related
Jul 31, 2014
I want write my first application using Xamarin Studio and GTK#.
I create new file Dialog.cs: public partial class Dialog : Gtk.Dialog
I add Fixed container and can't add buttons, why?
I must use class Window : Gtk.Window instead of Dialog and show modal this window?
View 2 Replies
View Related
Jun 24, 2014
The opjective was to build an c# deskop windows application for an classic car sales company.
My job was the employees section of the application.
my problem is the following
i have 3 tabs
summary (overzicht)
details
mutation (muteren)
on the details tab i have 2 buttons and a search box both the buttons only do somthing on the summary tab where they also need to take the selected row to the field on the other tabs.
the search box is a text box that neds to find the valve in the summary tab and then als so select the full row and put it in the onther 2 tabs fields.
this is the code for the back en next buttons
private void btnback_Click(object sender, EventArgs e)
{
if (dataGridView1.CurrentRow.Index >= 1)
{
[Code]....
View 14 Replies
View Related
Feb 27, 2012
I want to assign a matrix to submatrix of a bigger matrix.
ublas::matrix<int> A(8,5);
ublas::matrix<int> B(2,5);
for(size_t i=0;i<A.size1();++i)
for(size_t j=0;j<A.size2();++j)
A(i,j)=i*A.size2()+j+1;
for(size_t i=0;i<B.size1();++i)
for(size_t j=0;j<B.size2();++j)
B(i,j)=i*B.size2()+j+5;
ublas::matrix_range<ublas::matrix<int> > a(A,ublas::range(0,2),ublas::range(0,5));
a=B;
and it works.
but if the matrix is compressed_matrix type, there's something with it. the error log as below:
Check failed in file boost_1_48_0/boost/numeric/ublas/detail/matrix_assign.hpp at line 1078:
detail::expression_type_check (m, cm)
terminate called after throwing an instance of 'boost::numeric::ublas::external_logic'
what(): external logic
Aborted
I'm not sure this is a bug or not.
View 2 Replies
View Related
Oct 7, 2014
I am developing a small game using MFC in which the game options like new game, save, open, exit etc. can be selected from the menu as well as from the buttons inside the window. I have no problems with the menu but the buttons do not seem to work at all.
The buttons are created at runtime using CButton class. To associate the buttons with the corresponding functions, I just used the same resource ID for the buttons as the menu options, but that did not work. When I click on the buttons, nothing happens. If I assign different resource IDs to the buttons, how do I handle the message map entries? Do I have to write different message map entries for the menus and the buttons while their function is exactly the same?
View 6 Replies
View Related
Apr 13, 2014
I am pretty new to windows programming, but i get around with small applications.
Now I want to create a window with 10 push buttons, and was just wondering if there is some smart way, maybe in a loop to create multiple buttons.
Also, on a very populated window, is there a way to maybe have the WM_CREATE commands stowed away in another cpp file? Just for readabilty.
View 13 Replies
View Related
May 27, 2012
I have a txt file of drinks, and I want to meak a list of buttons of it (the txt file is build like this: fanta : 2 ), how can I make buttons of all the drinks ( I get the first one in a button , but not the others).
Dictionary<string, double> drank = new Dictionary<string, double>();
string[] words = new string[8];
Button button;
<Button> BtnList = new List<Button>();
[Code] ....
View 1 Replies
View Related
Oct 13, 2012
I want to make something like this for a game:
It is a "list box" that has 2 scroll buttons (scroll bar not needed). One button push, "scrolls" the list one entry.
Needs to run crossplatform (windows, linux).
View 4 Replies
View Related
Oct 13, 2012
I want to make something like this for a game:
Attachment 30507
It is a "list box" that has 2 scroll buttons (scroll bar not needed). One button push, "scrolls" the list one entry.
Needs to run crossplatform (windows, linux).
View 2 Replies
View Related
May 23, 2012
how can I create a GUI application that can resize also the control buttons. If the user decide to make the windows bigger or smaller I would like my textbox, buttons, etc.. to follow. Like in Java they use a layout manager, but I can't seem to find the answer for c#. I though to use table layout panel, but it doesn't expand when expanding the windows, unless i miss something
View 3 Replies
View Related
Mar 26, 2013
Is there an easy way to create a column of buttons ina listView?
I need that every file of the listView has a button in the first cell. Is that possible?
View 2 Replies
View Related
Jan 15, 2014
How to increase font size for a specific button? I tried to change the nHeight but it doesn't seems to change the font size.
Code:
CFont font;
font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_REGULAR, // nWeight
[Code] ....
View 3 Replies
View Related
Oct 17, 2013
I have multiple bitmap buttons of non-square shape. Because of their odd shape I can overlap them and they will still look good on screen, which is what I want - that certain layout.
The problem is that because underlying button in reality is square (which I am subclassing), the bitmap of one button may overlay with the non-bitmap area of the other button (in the underlying square). This means that 2nd bitmap button will not receive notification because the press is registered with top level window only.
Is there a way that both windows can receive the notification and check if they are in the hot spot, they will respond? I know this is against windows design.
View 10 Replies
View Related
Oct 15, 2012
I have successfully compiled a code where I created an array of buttons. I have added a click event to it like this :
Code:
buttons[indexofhashis2]->Click += gcnew System::EventHandler(this, &Execute::GOBUT_Click);
I have a standard event like this
Code:
private: System::Void GOBUT_Click(System::Object^ sender, System::EventArgs^ e) {
int x;
x = sender->Location.X;
}
Returns error saying Location is not a member of Object^.
I'm trying to create an array of button (user/runtime created buttons) and get different interpretations of the click event depending of wich button is clicked.
For example, if we create buttons[0] I wish to get the 0 or something relevant into the GOBUT_Click event.
View 4 Replies
View Related
Dec 31, 2013
I'm trying to find a way to remove an item that has been dynamically added when I change my drop down list selected user. The way this works is I add an edit and delete button dynamically when I select a user. I need to have the existing one be removed when I change users. Here is the code I'm using to build the two buttons. How do I remove them? Do I wipe out the columns and then add the columns again?
try {
dgvBG.DataSource = this.bgDataTableAdapter.GetData(cbPatientID.SelectedItem.ToString());
try {
Image editBGImg = Properties.Resources.editor;
Image delBGImg = Properties.Resources.del;
DataGridViewImageColumn btnBGEdit = new DataGridViewImageColumn();
[Code] ....
View 4 Replies
View Related
Aug 8, 2013
//#import "c:windowsSysWow64mscomctl.ocx" raw_interfaces_only //in window7
using namespace MSComctlLib;
CComPtr<IButtons> pButtons;
CComPtr<IButton> pButton;
CComPtr<IImages> pImages;
[Code] ....
View 11 Replies
View Related
Jun 12, 2014
I'm pretty much newbie in creating a successful GUI in C++. Although, i managed to create 4 buttons that should show a certain form. Lets say, Form1 is my main form, therefore - Button 1 will open Form2, and Button 2 will open Form3..... But the conditions is - If there is a form that is already open, clicking again on the Button that should open it, will Close it, but all the forms (form1,2,3,4,5) can be enabled together.
Also, a very important note is that whenever i close a form, in any way of closing it (Not the main form) It will "save" the changes i made (Such as ticking checkboxes and so..) and won't reopen it, it will just use "Visible" i guess ?
Notes :
If i use Form2 ^form2show = gcnew Form2;
and then Form2->Show();
I will be able to simply ATTACK the button and open Billions of form2 ^_^
Although, when i use Form2->ShowDialog();
It won't let me open the form3,4,5.
Which isn't so bad, but when i exit from the form2, it won't save my changes (Such as checkboxes..)
View 6 Replies
View Related
May 25, 2014
I have to prepare a project. But I don t know how can I do this. Program will find a matrix P for a square matrix A such that P^-1 A P ....
View 15 Replies
View Related
Mar 26, 2012
I have a calculator with buttons, and when I click the numbers or operators, it goes to a string array. So;
Press 3
Press +
Press 2
Press =
and my array is str[0]='3' str[1]=.... so on...
And also I have a C code which calculates the string you entered with some algorhytms and gives a double value as a result. So the question is;
How can I send my STR array in C# to my C program? I mean I want to use my C program as a source code. and How to return that double value to my C# program?
For now, I don't want to change my C codes into C# codes. I want it to keep as is. Just use it as a source code. Is that possible?
View 2 Replies
View Related
Oct 4, 2014
3 3
2 1 3 2 3
1 0 2
1 2 6
First line shows row and column number
First index of the second line tells the number of non-zero entries of the first row and second index tell the column number where the non zero entry is placed
for 1st row of matrix:
non-zero entries=2
column number=1
non-zero entry=3
column number=2
non-zero entry=2
covert this in the given form
0 3 3
2 0 0
0 0 6
View 1 Replies
View Related
Oct 17, 2013
I have a 3x3x3 matrix with values hanging from 1 to 27.
The order is this: Code: m[0][0][0] = 1;
m[0][0][1] = 2;
m[0][0][2] = 3;
m[0][1][0] = 4;
m[0][1][1] = 5;
m[0][1][2] = 6;
.
.
.
m[1][0][0] = 10;
m[1][0][1] = 11;
m[1][0][2] = 12;
.
.
.
m[2][2][0] = 25;
m[2][2][1] = 26;
m[2][2][2] = 27;
Is there an easy way to compute the indexes given the value? For example, I know that the first index can be found by dividing the value by 9.0: Code: const int firstIndex = ceil(value / 9.0) - 1; What about the second and the third indexes? I couldn't find a pattern in the numbers, and I didn't want to iterate through the matrix (the indexes will be calculated many times).
The other option is to create arrays where the values will be indexes and the matrix indexes will be the values. I'm not sure if it is the best way though
View 6 Replies
View Related
Mar 6, 2015
I've a code and it works on my linux laptop; however it doesnt work on a matrix server. Im getting error Code: file.c: In function CondCheck:file.c:40:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] The code of the programme
Code:
#include <stdio.h>
#include <string.h>
#include <math.h>
/*DECIMAL TO BINARY CONVERTER*/
int BinaryConverter (int bina)
}
[code]....
View 1 Replies
View Related