|
Yes it is the way to do this.
No, it does not get you out of reading the documentation.
|
|
|
|
|
Member 4169628 wrote: immediately goes fullscreen All the examples I've seen set the fullscreen mode only when the state of the Player is Playing!
|
|
|
|
|
Hi,
i have a very strange problem with CheckBox ComboBox Extending the ComboBox Class and Its Items[^]
First, i have two of them on my form. When I check a Item in one of them, i call a method that reloads the entries of the second ComboBox consider which Item was selected in the first ComboBox, after that the method checks the Items which was checked before the entries of the second ComboBox were reload. This should work in two ways.
It works fine when I Select one Item in the first ComboBox and one item in the second ComboBox (My Method checks the "earlier checked Items of the other ComboBox") but when I select two or more Items in the second ComboBox the method dont checks the "earlier checked Items". I hope it was unterstandable, my english isn't the best...please ask when you have any questions.
Here is my Code.
1. ComboBox (cbArticle) CheckBoxCheckedChanged Event:
private void cbArticle_CheckBoxCheckedChanged(object sender, EventArgs e)
{
if (cbArticle.Text != "Artikel auswählen")
{
cbArticle.ForeColor = SystemColors.WindowText;
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
string[] arrMethods = cbMethod.Text.Split(',');
cbMethod.Items.Clear();
FillMethods();
cbMethod.CheckBoxCheckedChanged -= cbMethod_CheckBoxCheckedChanged;
for (int i = 0; i < arrMethods.Length; i++)
{
try
{
cbMethod.CheckBoxItems[arrMethods[i].Trim()].Checked = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
cbMethod.CheckBoxCheckedChanged += cbMethod_CheckBoxCheckedChanged;
}
else
{
cbArticle.ForeColor = SystemColors.GrayText;
FillMethods();
if (finished)
{
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
}
}
}
2. ComboBox (cbMethod) CheckBoxCheckedChanged Event:
private void cbMethod_CheckBoxCheckedChanged(object sender, EventArgs e)
{
if (cbMethod.Text != "Methode(n) auswählen")
{
cbMethod.ForeColor = SystemColors.WindowText;
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
string[] arrArticles = cbArticle.Text.Split(',');
cbArticle.Items.Clear();
FillGroupCodes();
cbArticle.CheckBoxCheckedChanged -= cbArticle_CheckBoxCheckedChanged;
for (int i = 0; i < arrArticles.Length; i++)
{
try
{
cbArticle.CheckBoxItems[arrArticles[i].Trim()].Checked = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
cbArticle.CheckBoxCheckedChanged += cbArticle_CheckBoxCheckedChanged;
}
else
{
cbMethod.ForeColor = SystemColors.GrayText;
FillGroupCodes();
if (finished)
{
GetQueryType(gbTimespan.Controls.OfType<RadioButton>().FirstOrDefault(n => n.Checked));
}
}
}
When I debug the Code it works fine every time. I can see that the checkbox CheckedStatus is checked. But when the Method has ended and my Application switches back to the UI the CheckBoxes aren't checked... I call no other Methods (checked in debugger) but I can see that the CheckBoxComboBox.cs opens in Visual Studio it jumps in the following Code Blocks.
public partial class CheckBoxComboBox : PopupComboBox
{
#region EVENTS & EVENT HANDLERS
public event EventHandler CheckBoxCheckedChanged;
private void Items_CheckBoxCheckedChanged(object sender, EventArgs e)
{
OnCheckBoxCheckedChanged(sender, e);
}
#endregion
#region EVENT CALLERS and OVERRIDES e.g. OnResize()
protected void OnCheckBoxCheckedChanged(object sender, EventArgs e)
{
string ListText = GetCSVText(true);
if (DropDownStyle != ComboBoxStyle.DropDownList)
Text = ListText;
else if (DataSource == null)
{
Items[0] = ListText;
CheckBoxItems[0].ComboBoxItem = ListText;
}
EventHandler handler = CheckBoxCheckedChanged;
if (handler != null)
handler(sender, e);
}
...
}
[ToolboxItem(false)]
public class CheckBoxComboBoxItem : CheckBox
{
#region PROTECTED MEMBERS
protected override void OnCheckedChanged(EventArgs e)
{
if (_CheckBoxComboBox.DataSource != null)
{
PropertyInfo PI = ComboBoxItem.GetType().GetProperty(_CheckBoxComboBox.ValueMember);
PI.SetValue(ComboBoxItem, Checked, null);
}
base.OnCheckedChanged(e);
if (_CheckBoxComboBox.DataSource != null)
{
string OldDisplayMember = _CheckBoxComboBox.DisplayMember;
_CheckBoxComboBox.DisplayMember = null;
_CheckBoxComboBox.DisplayMember = OldDisplayMember;
}
}
#endregion
Please help me...I am totally frustrated after sitting 2-3 days on this issue...
|
|
|
|
|
If you have a question on an article, the best place to ask is in the forum at the bottom of that article: Comments[^]
The author of the article is usually the best person to help with the code they've written.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Of course, but I think the autho of this article is no longer active.
|
|
|
|
|
i hardly use generic. so anyone can explain what is generic and when one should use it. i like to know in what kind of situation developer use generic? i like to request to give some sample code which explain the good usage of generic.
what is the meaning of the below line
public class User : DBObject<User>
{
}
what is the meaning of this line specially
DBObject<User>
tbhattacharjee
|
|
|
|
|
Read this for an introduction and you'll get the idea (I hope): An Introduction to C# Generics[^]
In a nutshell: Generics enable one to make very general type definitions where types of subcomponents/parameters can be changed without changing the code of the type that uses them.
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
thanks for the help
but u did not answer for this line
public class User : DBObject<User>
{
}
what is the meaning of this line specially
DBObject<User>
tbhattacharjee
|
|
|
|
|
The meaning of "DBObject<User>" is the collection of User types,and the declaration of the public class User is an inherited class of DBObject<User>.
public class User : DBObject<User>
{
}
"Indian Hacker"
Debabrata Panigrahi.
|
|
|
|
|
Hi Debabrata,
thanks for answer. still things is not very clear to me. u said collection....ok. i have one more request. can you please write small full sample code similar to my situation which would explain well the usage like
DBObject<User>
looking for your help. thanks
tbhattacharjee
|
|
|
|
|
Read the link that was provided in the first answer to your question. That answers it all. Better still, actually read a book on this stuff. There are free ones available that are excellent. Charles Petzold's .NET Book Zero[^] is a great resource to help you get started. Seriously, you have to start doing some of this for yourself. If you don't, your career is going to go nowhere because all you have learned is that other people know things and you don't.
|
|
|
|
|
He did answer it. You actually have to read the associated article and then think about it for a bit. You've been here and asked enough questions by now to know that we expect you to do some of the work yourself.
|
|
|
|
|
I am trying to telnet a HProCurve J9279A Switch but i am getting some unknown characters in the login prompt when i am writing the response in text file . Please let me know how to handle this and remove these junk characters from string . I can say these are some escape sequense which in not recognized by string .
Please register your products now at: www.ProCurve.com
[1;24r[1;1H[24;1HUsername: [?25h[24;1H[?25h[24;11H[24;11H[?25h[24;11H
Please help to remove thse unknown characters in above strings and command outputs. any help will be appreciated...
|
|
|
|
|
Ok, those are VT100 / VT220 terminal control sequences and then consist of ASCII characters:
ESC [ n ; n x Where:
ESC is Hex 1B
[ is [
n is a number, in ASCII digits: '0' (hex 30) to '9' (hex 39) repeated
; is ;
x is a command code which tells the terminal what to do Some parts are optional, and question marks can be included as well!
The command code is an ASCII character which (IIRC) will be upper or lower case 'a' to 'z'.
The command code tells the system what to do with the whole command: r is a "Set scrolling region" command, H is cursor positioning, and so forth.
(You can find out what they do here: http://epsfiles.intermec.com/eps_files/eps_man/977047037c.pdf[^] - section 8)
To remove them, you will have to parse the string yourself, and find the start and end of the sequence: it may be possible to do it with a regex, but I've never tried (And am not about to! )
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
A quick thought (it's amazing what else you can think of when in a boring meeting) gives me this regex:
\x1B\[\??\d+(;\d+)?[a-zA-Z] That with a regex Replace operation replacing with a empty string should get rid of them. Probably.
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Thanks.... Its working
|
|
|
|
|
You're welcome!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
I run into the same problem and have figured out a workaround that works for as. It is not a perfect solution.
I use a regular expressions substituions between the TCP buffer and the Telnet protocol because the firmware sometimes use unknow esc sequnences that bother the telnet/terminal protocol.
I use Perl for switch automation but i try to translate it to C# (The orginal is a Perl module
Regexp::Common::ANSIescape ).
I use this expression
\x1BE/\n before the big one and this after
\[[0-9]+;[0-9]+H because the firmware use sometimes esc secuences that does not exist.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ProcurevAnsiFilter {
class Program {
const string CHAR_STR = @"(.|\n)*?";
const string CSI_7BIT = @"\x1B\\\x5B";
const string CSI_8BIT = @"\x9B";
const string CSI_7OR8 = @"(?:" + CSI_7BIT + "|" + CSI_8BIT + ")";
const string C1_NST_8BIT = @"[\x80-\x8F\x91-\x97\x99\x9A\x9C]";
const string C1_NST_7BIT = @"\x1B[\x40-\x4F\x51-\x57\x59\x5A\\\x5C]";
const string C1_STR_7BIT = @"\x1B[\x5D\x50\x58\x5E\x5F]";
const string C1_STR_8BIT = @"[\x9D\x90\x98\x9E\x9F]";
const string C1_STR_7OR8 = @"(?:" + C1_STR_7BIT + "|" + C1_STR_8BIT + ")";
const string ST_7BIT = @"\x1B\\\\";
const string ST_8BIT = @"\x9C";
const string ST_7OR8 = @"(?:" + ST_7BIT + "|" + ST_8BIT + ")";
static void Main(string[] args) {
string[] tmp = new string[] {
@"(?:[\x30-\x3F]*)(?:[\x20-\x2F]*[\x40-\x7E])",
C1_NST_7BIT,
C1_NST_8BIT,
C1_STR_7OR8 + CHAR_STR + ST_7OR8
};
string regex = "(?:" + string.Join("|", tmp) + ")";
Regex reg = new Regex(regex);
}
}
}
|
|
|
|
|
Hi everyone,
i am using Visual Studio 2012 and Sql Server 2008 R2.
i am writing a program that is about inventory tracking.
All of my works is done.
it is working very well in Visual Studio.
And i have to create setup file.
i use installsheild 2013 LE.
I am constantly encountering errors in the setup file.
occurs difference with version of sql server which another computer and mine
and there are many errors about different case.
So let me know please, how i create setup file in this situation.
i want to automaticaly setup sql server,net frameworks and my project.
|
|
|
|
|
First, do NOT install SQL Server as part of your setup. Reason being is that MS doesn't license nor support doing that. SQL Server should be installed completely separately. This give admins the option of using their own SQL Server to host your app data instead of managing yet another instance of SQL Server.
|
|
|
|
|
Ok thanks. i handled net frameworks. i will install sql separately.
Do you know why occured difference between two computers sql versions?
my sql is sql server menagement studio 2008 R2 and other computer have Microsoft SQL Server 2008 Express SP1.
is that so?
|
|
|
|
|
You're not comparing the same thing. The first one is a tool used to manage SQL Server and can be used on multiple versions of SQL Server and the second is a database engine.
So, yes, it's possible to have both of those installed on the same machine.
|
|
|
|
|
i am creating a exe file using visual studio 2010, if i send it to my frnd who doesnt have visual studio, will it run over his system ??
|
|
|
|
|
Only if he has the .NET Framework version installed that your app targeted when you built it.
Open the Project Properties and look at the Application tab. In there you'll find a dropdown with the Target framework specified.
|
|
|
|
|
As you are using Visual Studio 2010, it's a simple matter for you to create an application installer - it's one of the project types. This will include the relevant .NET framework version as a prerequisite.
|
|
|
|