|
Not that I know of
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok,
thanks.
I have done a class and made some "new" on it. it seems to work
Best regards.
There is no spoon.
|
|
|
|
|
Hi,
you can have a "static constructor" containing code to initialize static members (including
const).
AFAIK you must be careful when a static constructor calls onto another class that also
has a static constructor, I think there is some unwanted behavior then. But it works well
in simple cases.
|
|
|
|
|
I have to make an ActiveX control so tht I can use it in other applications.I referred following link
http://www.c-sharpcorner.com/UploadFile/dsandor/ActiveXInNet11102005040748AM/ActiveXInNet.aspx
Followed exactly same steps.
i made a class library and referenced its dll in another webform where i m using the members of
the class library through Javascript.but the members are not accessible in Javascript.i.e.
function doScript()
{
myControl1.UserText = Form1.txt.value;
}
in this javascript function the UserText member is not getting called.
What's the mistake i m making?
|
|
|
|
|
If you have to use ActiveX ( for VB6 or something ), you should use C++. Using C# means you still need .NET, what's the point in that ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
actually my aim is to make an ActiveX control which have a listbox and some command buttons.I have done it in both C# and VB6.0
for C# i referred
http://www.c-sharpcorner.com/UploadFile/dsandor/ActiveXInNet11102005040748AM/ActiveXInNet.aspx
and for VB6.0 i referred
http://cuinl.tripod.com/tutorials/ocx-11.htm
and followed the same steps.
My application should work like this:
ActiveXcontrol1(Listbox and Refernce to ActiveXcontrol2 as a command button)-> Click CommandButton1 (let's say "open File") ->Goto ActiveXcontrol2->Click CommandButton Cancel->Return to ActiveXcontrol1
or
ActiveXcontrol1-> CommandButton1->ActiveXcontrol2->OK->Perform some action
When I include the .ocx file of ActiveXcontrol2 through Project->Components and the control appears in toolbox and drag the control and place it on the ActiveXcontrol1 and click on the commandbutton to display the ActiveX control2 i.e. the control with some stuff and OK and Cancel button, this is not getting displayed.
i.e. not calling the ActiveX Control2.
Language is not a problem! i can make it in C# or in VB6.0.But i m not able to do tht!
|
|
|
|
|
Is there a standard function to convert a hex to a binary value?
Thanks,
Monk
|
|
|
|
|
|
I don't know if there's a .NET function for this, but if you can't find any, it's very easy to convert from hex to binary "by hand".
Here's how to do it. As you should know, the hexadecimal system has 16 digits: 0,1,...,9,A,B,..,F, therefor 4 bits are necessary to convert each hex digits.
So:
Hex Binary
0 0000
1 0001
2 0010
3 0011
. .
. .
. .
F 1111
In order to covert an array from hex to binary, you just read each hex digit one by one and replace it with the 4 bits which correspond to it. Of course, the resulting binary array will be 4 times longer than the original hex array.
Hope that helps.
|
|
|
|
|
If it's hex, it must be a string ( otherwise it would just be a number ). So, I'm not sure if int.Parse will take hex, you may have to write something. To convert a number to it's binary representation, string.Format will be just fine ( that is, there are format strings for that ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a user control that contains a lot of controls,
while the printing of these controls didn't finish yet, the program starts the on_paint() and do it again after finishing the paint...
I want to catch the finish painting or other way to do it
aukh
|
|
|
|
|
There is no such event. If you're doing your own painting, you can obviously add one.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I'm not sure what your problem would be, normally all painting is (or should be) done
by the UI thread. So the paint methods dont have to be re-entrant.
Of course, if your form, drawing, whatever, changes a lot, then the CPU would be
repainting it most of the time, unless you tell it not to, e.g. by calling the
Control.SuspendLayout() and ResumeLayout() methods which I strongly recommend when you
plan on massively populating/updating big controls such as a list view.
Hope this helps.
|
|
|
|
|
Guys,
I have a multiline textbox. When I send a hardcoded string line1\r\nline2 to it. All is OK. When I use that same string in my resources it shows the \r\n as characters instead.
Is there a way around this?
thanks !
V.
I found a living worth working for, but haven't found work worth living for.
|
|
|
|
|
You should never use \r\n. Use Environment.NewLine instead.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Lol, I solved the problem by setting a character sequence never used like '[br]' in my code I replace it by '\r\n'. But I'll change that to Environment.NewLine .
|
|
|
|
|
Hello,
Did this just for fun, because you made me curious about that problem.
I only made a quick test, so maybe there are some bugs.
using System;
namespace WindowsApplication1
{
public class ValidatingTextBox : System.Windows.Forms.TextBox
{
private bool BlockTextChanged = false;
private const string EnterString = @"\r\n";
public ValidatingTextBox()
{
}
protected override void OnTextChanged(EventArgs e)
{
if(!BlockTextChanged)
{
BlockTextChanged = true;
if(this.Text != string.Empty)
{
for(int x = Text.IndexOf(EnterString,0); x<this.Text.Length && x>-1; x = Text.IndexOf(EnterString,x))
{
SendEnterAtIndex(x);
}
}
BlockTextChanged = false;
}
base.OnTextChanged(e);
}
private void SendEnterAtIndex(int index)
{
this.Text = this.Text.Remove(index, EnterString.Length);
this.SelectionStart = index;
this.Text = this.Text.Insert(index, System.Environment.NewLine);
}
}
}
All the best,
Martin
|
|
|
|
|
Lol, I made a replace which worked .
I changed my hardcoded '\r\n' to System.Environment.NewLine incode.
like this: msg_editowner.Replace("[br]", Environment.NewLine)
'[br]' is what I put in my resources instead of '\r\n'. .
|
|
|
|
|
Hi.
Is it possible to set the style to StandardClick/StandardDoubleClick to only a control on a form and not the form itself?
Thanks.
|
|
|
|
|
Hello,
Can anyone of you send me a code which is getting value from a xsl variable or param in .cs file of a c# project? for example; I have a xsl:param name="size" and value =35 now I want to show this in .cs file by using Response.Write(variablename);
Please let me know soon if anyone of you knows its solution. I really need it. P.S send me code as well. This is my second post but still not getting right answer.
Regards,
Abubakar
|
|
|
|
|
Load the XSL file into a XmlDocument , use the SelectSingleNode method to select the param element or its value attribute directly and then retrieve the attribute value.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I tried but couldn't find a solution. I try to send you code of XSL file. xsl file name is "test.xsl" and param is defined just like that without commas "<xsl:param name="testParam">TestValue" please send me c# lines of code to get value of this param in .cs file.
Regards,
Abubakar
|
|
|
|
|
I tried but couldn't find a solution. I try to send you code of XSL file. xsl file name is "test.xsl" and param is defined just like that without commas "<xsl:param name="testParam">TestValue</xsl:param>" please send me c# lines of code to get value of this param in .cs file.
Regards,
Abubakar
|
|
|
|
|
Abubakarsb wrote: I tried but couldn't find a solution.
Ok, so what do you have so far?
Abubakarsb wrote: I try to send you code of XSL file.
Post it here, so anybody can see it and can help you.
Abubakarsb wrote: please send me c# lines of code to get value of this param in .cs file.
I'm not going to write the whole thing for you. If you get stuck at some point, I will help as best as I can, but you have to show that you at least tried yourself (by showing what you've got so far). Start by looking at the documentation of the XmlDocument class, its SelectSingleNode method and the continuative links. They contain many examples on how to work with XML and should give you a good starting point.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Code written in XSL File:
<<xsl:variable name="size" select="ceiling(count(.//Category[Title=$subtitle]/Category/MetaData))" >="">
Code written in ..cs File:
XmlDocument xdoc = new XmlDocument();
xdoc.Load(URL);
xdoc.SelectSingleNode("xsl:variable");
|
|
|
|