C# :: Custom Control Properties?
Sep 23, 2014
I have been trying to make a custom control(list box with more features). I know how to setup custom properties, but how do I make it so that the property can be edited in a separate window ?
I think I figured out how to show the form itself, and I don't know how to make the [...] button like :
There's not much Custom Control tutorials out there, and that's really the problem here.
View 1 Replies
ADVERTISEMENT
May 24, 2014
I have researched quite extensively, experimented, and still cannot seem to change the properties of a control on an active winform from a user control.
So I have a user control which populates each dynamically added tab page in a tab control.
I have a textbox in the user control which I would like to type in, capture the text_change event, and change the text of the label in the winform.
View 14 Replies
View Related
Mar 15, 2015
i want to design a custom control (Ui widget library) , this library can be used by any IDe developer to develop his UI.
how to design a custom control library and plug in.
View 11 Replies
View Related
Apr 8, 2015
I'm having a custom control and I added a vertical scroll bar to it. After scrolling down and then up what all controls are added are disappeared. Controls added are (checkboxes, editboxes, browse button).
Scroll works fine. Looks like painting problem but unable to resolve the issue.
code snippet:
void MyCustomControl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) {
int minpos, maxpos;
GetScrollRange(SB_VERT, &minpos, &maxpos);
maxpos = GetScrollLimit(SB_VERT);
[Code] ....
View 3 Replies
View Related
Apr 25, 2014
How do I bind a DATE column in a DataGridView Control to a DatePicker control (using C#)? I already have the DataGridView control bound to a database stored procedure which takes a DATE value as a parameter and selects joining table based on the results.
View 7 Replies
View Related
Jun 29, 2014
Is it possible to access file properties from c++ program? For example, user could drag file to program and then it displays a detailed information about file like date modified, size, type and etc..
View 1 Replies
View Related
Feb 26, 2015
I have startes making a game where there is 3 ships that cross the screen verticaly, and the point is to shoot them down. So far I have actually managed to do this. I have also managed to add gamescore to the ships. But here is my problem, I cant find a way to combine the score from all three ships in to one score. I have all three ships in different classes, is that wrong? When I try to combine the scores, ship score1 cant see the other scores.
Do I need to somehow have all the ships in one class. Or are there a way to read the scores from three classes, and adding them up in to one in a new class?
One of the errors I get is "the name 'score1' does not exist in the current context.
View 14 Replies
View Related
Nov 2, 2014
I've been attempting to design a multiform WFA in Visual Studio 2010, but I'm so rusty with the language it's hard to remember how to do a lot of things, especially when it comes to visual programming, which my class only partially covered. I've never made a multiform application before, and my problem essentially boils down to how to pass data between forms.
My application is a simple item list and order form, sort of mimicking what you might see on a site like Amazon or eBay. My first form contains a drop down list and 'checkout' button. The dropdown list has been populated with an object collection, each object holding the product's name and price.
public partial class Form1 : Form
{
//Item class for dropdown menu
public class Item {
public string Name;
public decimal Price;
public string itemName
[Code] ....
When the 'checkout' button on form 1 is clicked, I want the Price and Name properties of the selected droplist item to appear in a pair of text boxes on form 2 for the purpose of lowering the user's cognitive load (if they can see what they've selected, it's one less thing to remember).
I've seen plenty of tutorials on how to send a textbox Text property between forms, but none for how to do this. As I said, I'm rusty with the language, and I'm pretty sure there's a better way to set up my combobox items, but I can't remember how to set it up.
View 12 Replies
View Related
Jan 28, 2014
Code using auto-implemented property:
public class MyClass {
public int age { get; set; }
}
static void Main(string[] args) {
MyClass testing = new MyClass();
testing.age = 44;
Console.WriteLine(testing.age);
}
output: 44
Code using regular variable declaration:
public class MyClass {
public int age;
}
static void Main(string[] args) {
MyClass testing = new MyClass();
testing.age = 44;
Console.WriteLine(testing.age);
}
output: 44
Why use the auto-implemented property when you can just as equally use the second code block to achieve the same thing?
View 14 Replies
View Related
Jun 29, 2014
I had written a "DLL" in VB.NET a year or two ago to read and set MP3 tags. I want to write this exact same library in C++ so I can convert it in my droid project, and to get a hands on introduction to C++. So far this attempt has been a total mind melt!
I am finally wrapping my head around .cpp and .h files so there is light at the end of this tunnel. Here is my problem now:
I wrote the VB project with properties for each tag in the MP3 file, then I could get and set them - easy stuff.
When I try this in C++ I get compile error: a property can only appear within the definition of a managed type. I can usually stumble through Google searches and figure out this type of stuff on my own, but this one is stumping me -- I think I am missing some fundamental stuff here.
My code:
// MP3Tags.h
#pragma once;
#include <string>
using namespace std;
using namespace System::IO;
[Code]....
View 4 Replies
View Related
Jan 15, 2015
Well I know how to pass values between forms using get and set properties. But the problem with it is everytime I want to pass values from form2 to form1 it doesn't appear. To make it appear I have to type form1.Show(); which open form1 a second time and then show the value. Is there any way I could make it appear without using form1.Show();?
View 9 Replies
View Related
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
Aug 20, 2014
I'm trying to get my head around threading and gui applications for fun, and I've ran into a problem I'm not too sure how to google it correctly or I don't understand the answers given. Basically I'm trying to access GUI item properties (add to a listview). I've been on stackoverflow alot, and I've noticed that accessing these properties is quite difficult. At least, I'm not really understanding how it is supposed to be done.
The following line gives me a null value.
frm.lstChat.Items.Add(newList);
From what I understand I need to access my form object instead of creating a new object window... but I'm not sure how to reference the initial form application.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Net.Sockets;
using System.IO;
using System.Threading;
namespace ModBot {
[Code] ....
View 3 Replies
View Related
Mar 4, 2013
I have to edit 4-5 lines in the debug, and then 5 lines in release for each of my little project's properties.
View 2 Replies
View Related
Dec 14, 2014
How can I write my own container which has properties of both vector and list.
E.g. I can access elements directly using [] operator like vector and behave like list in terms of memory (means we don't have to shift elements if we want to insert in between like list)....
View 1 Replies
View Related
Apr 30, 2013
I want to make such application in which user make directed graphs along with relations between them. After that application show that which graph properties are proved in this graph e.g Reflexive, Irreflexive, Symmetric, Anti Symmetric, transitive etc
View 1 Replies
View Related
Jun 10, 2013
How would you create a video game in c++? I'm not sure really how to display the graphics and set properties and do all that stuff. I don't have money to buy a book about so how do you?
View 2 Replies
View Related
Aug 1, 2013
I'm developing C++ application in visual studio 2012. I have couple of C++ projects in my solution. I have put some library paths in every project's properties ( i.e ,Config properties - > C/C++ - > Additional Include Directories and Linker - > Additional Include directories ).I developed in debug mode, if i change to release mode, all library settings gone.Is there any possibility to retain all settings when change to debug to release mode and vice versa ?
View 2 Replies
View Related
Feb 7, 2014
I'm trying to write a custom allocator that I can use with the STL. Here's what I have so far :
Code:
#include <cstddef>
#include <iostream>
#include <memory>
#include <vector>
template<class T>
struct customallocator {
[Code].....
I'm doing and currently, my push_back doesn't seem to do anything.
View 12 Replies
View Related
Oct 9, 2014
Let's say we have a custom Vector class and I need to know which of the following is considered to be more efficient and why of course.
Vector Vector::operator+(const Vector &b) const {
return Vector(x+b.x,y+b.y);
}
Vector Vector::operator+(const Vector &b) const {
Vector tmp(x+b.x,y+b.y);
return tmp;
}
View 1 Replies
View Related
Oct 8, 2013
I've written a doubly linked list per my assignment instructions. I've implemented begin() and end() iterators for it, and they work with no problems when traversing the list. However, I need to sort the elements in the list. We are allowed to use the sort function defined in the <algorithm> header since we haven't yet covered sorting algorithms.
But, I'm running into a ton of problems. I figured as long as the begin() and end() iterators were defined for the list, then sort(list.begin(), list.end(), compare) would do the trick. The main errors I'm getting are:
error: no type named iterator_category
error: no type named value_type
error: no type named difference_type
error: no type named pointer
error: no type named reference
And also errors for no match of the + and - operators for the iterator class.
I understand reference, pointer, and value_type, but I have no idea about iterator_category and difference_type. Additionally, I'm a little unsure why the + and - operators need to be overloaded.
View 8 Replies
View Related
Jul 13, 2014
I have a POPUP
MAIN_MENU MENU {
POPUP "&Manager" {
MENUITEM "New Royal Python", MENU_NEW_ROYAL_PYTHON
POPUP "&Select Python" {
}
}
}
I basically want to give the POPUP an ID so I can talk with it but it does not seem to be accepting a second parameter. Once I have done that I need to send a message to it to ask it to add a new item, what are the messages I need to send for this?
View 8 Replies
View Related
May 21, 2013
I am making a level editor that needs to output a custom map file for use with source code that I will write for a graphics library.
My question is: What do I need to bear in mind when deciding how to structure a custom file type? Also how can I encode a standard bitmap image into my file (the tile set) so that it can all be contained in a single file rather two files; the map file and tile set (.bmp file).
View 3 Replies
View Related
Nov 30, 2014
I have begun switching from WinForms to WPF and I'm having a hard time understanding the new concepts. In WinForms, I had a few User Controls, custom drawn using shapes (rectangles, ellipses, etc). They had some unique properties, like "Flashing" (setting this property to True and setting the "Flash Interval" property to 500 would have resulted in the control changing its background color to white and back again, every 0.5 seconds), "Beeping", etc.
I have tried to replicate these controls in WPF/XAML and so far managed to draw the shape. However, when it came to implementing a custom property that would redraw the background color of the rectangle every interval set by user in another property, i got stuck. The property is being set, but it doesn't change the background color. Alternatively, i have tried this method, with the same results (i got it to show in the "Properties" window in Visual Studio, i can set it, it is being stored in XAML, but it doesn't affect the background.
C# code behind:
public struct LCARSColors
{
public static Brush DarkBlue = (Brush)(new BrushConverter().ConvertFrom("#FF3366CC"));
public static Brush LightBlue = (Brush)(new BrushConverter().ConvertFrom("#FF99CCFF"));
public static Brush Pink = (Brush)(new BrushConverter().ConvertFrom("#FFCC99CC"));
[Code] ....
If i use this line (commented in this code sample):
<!--<SolidColorBrush x:Name="MySolidColorBrush" Color="{DynamicResource DarkBlue}" />-->
The background is colored in DarkBlue (as defined). But if i use this line:
<SolidColorBrush x:Name="MySolidColorBrush" Color="{Binding BackgroundColor, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
Nothing happens, the rectangle disappears entirely. If i add this to the above line:
FallbackValue=LightYellow
The rectangle is colored in LightYellow, meaning that the property is not accepted and the fallback value is used. Why?
View 9 Replies
View Related
Jul 12, 2014
I've done some research and found that people use Mah metro, though I don't want to use that because I want to make a GUI that is fully mine, so I can do what ever I want to customize it to my liking.
I don't know how to get this done in WinForms....
View 2 Replies
View Related
May 26, 2014
I was going through tutorial in WPF on customs Cursor, While Running the application i am getting an exception XamlParseException was unhandled, here the code
public partial class MainWindow : Window
{
public MainWindow()
{
[Code].....
View 4 Replies
View Related