|
|
Is it possible for me to somehow change the color of the Main Menu?
|
|
|
|
|
hello,
I am working on .Net framework in c# lang. and this
problem is related to Font Dialog class.The problem
i am facing is as below:
steps:
1)start an application containing a font dialog .
2)Install a new font while the application is running.
3)On applying the new font installed to any component
say textbox,the application throws an exception
with message:"Only true type fonts are supported and
this is not a true type font"
On debugging it is just after dialog.
if(ShowDialog()==DialogResult.Ok)
{
}
4)On restarting the application and appying the same
new font everything works fine.
How ever this is not the case with some of the
products in market eg Adobe Photoshop,Xml spy,Or
microsoftword..
Please suggest me regarding this.
Thanks and Regards
|
|
|
|
|
Hi To All
I have seen in almost all groups to my surprice nobody shown interest in SmartClient, So please do let me know if any of you are interested we can request a seperate group in code project.
Please do join me for this.
|
|
|
|
|
I'm not sure we need a seperate forum on CodeProject for Smart Client development. The existing C#, VB.NET and .Net Framework groups should be fine.
If the list of smart client questions grows then I'm sure the CP team will add a section, as SmartClients are as important as ASP.NET.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
Hi,
So I was given this data file, which i think is in binary format and i have to extract data from it starting at an offset of 1000. I tried opening the file in Wordpad and really have no clue how its encoded. I was able to mimic the way it was displayed in wordpad using a streamreader with a text encoding of utf7 then writing it to the console. Each value I'm trying to extract consists of 2 bytes and I have to convert this into a positive/negative integer. I tried many ways of doing this but was unable to get the right result. I noticed first of all, that the values i'm getting largely consist of zeros and all positives which is way wrong. The whole idea of binary files are so foreign to me and i have no clue where to begin on this. I really wish they had started us on C in school rather than java...
thanks in advance
|
|
|
|
|
Hi
I have a program which reads a xml schema file and also reads a input xm l file and if there is a element present in the schema which is also present in imput xml fle. it stores the vaues of input xml file for theat element intoa new xml file , while the other elements present in the schema are automatically getting values acccording to the datatype.
private void button2_Click(object sender, System.EventArgs e)
{
dataSet1.ReadXmlSchema(txtSchema.Text);//txtschema is the schema file
XmlDocument xdc = new XmlDocument();
foreach (DataTable dTbl in dataSet1.Tables)
{
object[] oValues = new object[dTbl.Columns.Count];
xdc.Load(@"C:\CDEV\generator\testdatagenerator\FIELDNAMES.xml");
int i=0, iIndex=0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(dColmn.ColumnName.ToString() == "billto_name")
{
iIndex = i;
break;
}
i++;
}
//INPUT XML FILE
xdc.Load(@"C:\CDEV\generator\testdatagenerator\billtoname.xml");
XmlNodeList nodeRows;
XmlElement Root = xdc.DocumentElement;
nodeRows = Root.SelectNodes("//billto_name");
for(int j = 0; j <= 200; j++)
{
int k = 0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(j == iIndex && j <nodeRows.Count)
oValues[j] = nodeRows.Item(i).InnerText;
else
{
switch(dColmn.DataType.ToString())
{
case "System.String":
oValues[k] = (string) "castle Hampers" + j;
break;
case "System.Int32":
oValues[k] = (int) 66 + j;
break;
case "System.DateTime":
oValues[k] = new DateTime(2004,01,30).AddDays(j + 1);
break;
case "System.Decimal":
oValues[k] = new Decimal(1900.99) + j;
break;
case "System.Int16":
oValues[k] = (short) 3256 + j;
break;
case "System.Int64":
oValues[k] = (long) 400 + j;
break;
case "System.Double":
oValues[k] = (double) 8888 - j;
break;
case "System.Single":
oValues[k] = (float) 4.5 + j;
break;
}
}
}
dTbl.Rows.Add(oValues);
}
}
}
I view the data's through a datagrid. But I get values only for the first field and the others are showing only null
santhosh
|
|
|
|
|
|
Hi
Now I had incremented k,But I find that in the first row, first value of the element(both element name same in schema and input xml) first value is from input value and other values for that columns are those specified for automatic insertion like castlehampers1, 2...etc.. and first row of other elements are null and from necxt row they are correct.
pls help me to do.
ie, my output was like this
--------------------------------------------------------------------------- -ie under the elemnet name "billto_name"(datatype-> string) the values as(james frank, castle hamper1, castle hamper2..etc.. up to 200)
under the element name "dividend" (datatype -> float) the values as (null, 5.5,6.5....)
under the element name "section"(datatype-> double ) the values as (null,8887,8886....)
-------------------------------------------------------------------------
u can see that it takes only the first value from input xml(ie, james frank is the value which is taken from input xml file) others like castle hamper1,2 are given by me in the program for a string datatype . And also the other values are correct from the second row and why it didnt assign a value for the first row (why its showing null).so pls help me to do this.
private void button2_Click(object sender, System.EventArgs e)
{
dataSet1.ReadXmlSchema(txtSchema.Text);//txtschema is the schema file
XmlDocument xdc = new XmlDocument();
foreach (DataTable dTbl in dataSet1.Tables)
{
object[] oValues = new object[dTbl.Columns.Count];
xdc.Load(@"C:\CDEV\generator\testdatagenerator\FIELDNAMES.xml");
int i=0, iIndex=0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(dColmn.ColumnName.ToString() == "billto_name")
{
iIndex = i;
break;
}
i++;
}
//INPUT XML FILE
xdc.Load(@"C:\CDEV\generator\testdatagenerator\billtoname.xml");
XmlNodeList nodeRows;
XmlElement Root = xdc.DocumentElement;
nodeRows = Root.SelectNodes("//billto_name");
for(int j = 0; j <= 200; j++)
{
int k = 0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(j == iIndex && j
|
|
|
|
|
|
I couldnt get the result.
Pls change my coding and sent . you can get my coding part in the previous thread.Pls help .
santhosh
|
|
|
|
|
How can I set the image property of a picturebox object at run time?
I have added to images (jpg) to my solution both with build action Embedded Resource, and I want to switch at run time which image is displayed. I can not use the ImageList because the image size exceeds 256x256 and is not the same for both pictures. (I might want to include more pictures in the future).
I also know that I can use the following code:
this.myPictureBox.Image = new Bitmap("C:\\myfolder\\myImage.jpg");
but if I use that code there better be an image at that location and that is not what I want. I want to embedd the image in the exe and then populate the image property of the picture box with the embedded images at runtime.
I thought a little more about this problem and I think I want to create an array of bitmaps and then load all the images into the bitmap array then I can use the following code to change the picturebox image property at runtime:
private void ChangeImage(int ImgIndex)
{
this.myPictureBox.Image = this.myBitmapArray[ImgIndex];
}
Well the problem still remains to find a way to load an image into a bitmap object. It is very easy to do if I specify the path and the filename but again that is not something I want to do.
I did find some information using the System.Reflection.Assembly class, but I could not quite figure out how to load the resource that is embedded.
Any assistance would be greatly appreciated.
Sincerely,
Einar
|
|
|
|
|
Hi Einar,
Check out this link on the Microsoft Newsgroups: howto load an embedded resource[^]
Basically, it involves this:
Assemly myAssembly = GetType().Module.Assembly;
Bitmap bmp = myAssembly.GetResourceStream("Namespace.Folder.File.Ext");
Replace the Namespace.Folder.File.Ext path accordingly. Of course, make sure your bitmap is actually embedded first!
Good luck.
This space for rent!
My Blog
|
|
|
|
|
I am looking for suggestions on a good way to visually layout database designs and class designs. I have seen in some articles where the database looks to be a screen shot from the SQL diagram and some articles show class designs.
|
|
|
|
|
I personally use a good ol' whiteboard. I invested in a 1200x900mm magnetic one a few weeks ago - I can't live without it now! However, a lot of people swear by Visio, as well.
If you're looking for a free alternative, you could try Dia[^]. Dia is an open-source diagram modelling tool which appears to be fairly good.
This space for rent!
My Blog
|
|
|
|
|
If you have a control on a windows form that has a ContextMenu enabled, and you would like to know WHICH control it is that the user has right-clicked, is it possible to pass the name of the control through to the menu click event so that it could process the control using that information? The sender object only retrieves the MenuItem object and not the name of the control that activated the menu click. How would I acquire the name of the control that activated the ContextMenu click event?
|
|
|
|
|
Like this:
MenuItem miSender = (MenuItem)sender;
ContextMenu cmSender = (ContextMenu)miSender.Parent;
TextBox tbSender = (TextBox)cmSender.SourceControl;
|
|
|
|
|
Thank You, Guinness4Strength ! Much appreciated.
New_Phoenix
|
|
|
|
|
I didn't see a DirectX board so I thought I'd post here since I am writing in C#.
I am having an issue with setting some vectors on a CustomVertex. Here is my code:
<br />
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)<br />
{<br />
device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI/4, this.Width/this.Height, 1f, 50f);<br />
device.Transform.View = Matrix.LookAtLH(new Vector3(0,0,30), new Vector3(0,0,0), new Vector3(0,1,0));<br />
device.RenderState.Lighting = false;<br />
device.RenderState.CullMode = Cull.None;<br />
<br />
CustomVertex.PositionColored[] vertices = new CustomVertex.PositionColored[3];<br />
vertices[0].SetPosition(new Vector3(0f, 0f, 0f));<br />
vertices[0].Color = Color.Red.ToArgb();<br />
vertices[1].SetPosition(new Vector3(10f, 0f, 0f));<br />
vertices[1].Color = Color.Green.ToArgb();<br />
vertices[2].SetPosition(new Vector3(5f, 100f, 0f));<br />
vertices[2].Color = Color.Yellow.ToArgb();<br />
<br />
device.Clear(ClearFlags.Target, Color.DarkSlateBlue, 1.0f, 0);<br />
<br />
device.BeginScene();<br />
device.VertexFormat = CustomVertex.PositionColored.Format;<br />
device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, vertices);<br />
device.EndScene();<br />
<br />
device.Present();<br />
<br />
this.Invalidate(); <br />
}<br />
The problem is with the vertices[x].SetPosition(new Vector3(0f, 0f, 0f));
When I try to compile, I get the error message: Microsoft.DirectX.Direct3D.CustomVertex.PositionColored does not contain a definition for SetPosition.
I have also tried: vertices[x].Position.Add(new Vector3(0f, 0f, 0f));
This doesn't give me an error, but it also doesn't render anything on the screen.
Also, I can render the triangle if I use CustomVertex.TransformedColored so I know that is working, but I need to use CustomVertex.PositionColored
In most of the examples I have seen, this is how it is done. If you know DirectX, then you also know it is very hard to find any sort of good documentation on it too. I don't know if most examples I am following are 8.0 and earlier. Is there another way to do this? Am I doing it right but missing something?
|
|
|
|
|
Hey!
I Have two list box the second list box need to be updated when the first listbox is updated with an item.
Is there any event that i can use on the first Listbox and by that update my secon list box?
I are adding data to my first list box from many places!
//SnowJim
|
|
|
|
|
What do you mean with updated; adding a value to the ListBox or a change of the selected value?
In case of the latter write an event handler for either the SelectedIndexChanged or the SelectedValueChanged event and update the second ListBox according to the selected value.
www.troschuetz.de
|
|
|
|
|
As soon as an item is addad i whant i event to be raised there i can write the new item into the seond listbox.
Else i will have to do i funktion that al are using, there i also change the second listbox but this will be alot to change.
So i thought that maby there is an event that is raised when an item is added that i can use?
//SnowJim
|
|
|
|
|
|
I've written an Add-in that creates a CommandBar with a CommandBarButton and CommandBarComboBox control. It looks and works great the very first time the add-in is run (when the OnConnection method executes). But if I close VS and re-open it, only the CommandBarButton control is the only control present. Below is the OnConnection method I use to create the CommandBar. Do I need to add the CommandBarComboBox control in a different way ?
public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
applicationObject = (_DTE)application;
addInInstance = (AddIn)addInInst;
if(connectMode == Extensibility.ext_ConnectMode.ext_cm_UISetup)
{
object []contextGUIDS = new object[] { };
Commands commands = applicationObject.Commands;
_CommandBars commandBars = applicationObject.CommandBars;
try
{
Command cmd = null;
try
{
cmd = commands.Item(FullCommandName,0);
}
catch(Exception Err)
{
Debug.WriteLine("OnConnection: "+Err.Message);
}
if(cmd!=null)
cmd.Delete();
cmd = commands.AddNamedCommand(addInInstance,CodeDepotRes.ProgID,CodeDepotRes.CommandName,CodeDepotRes.ToolTip,false, 102,ref contextGUIDS,(int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled);
CommandBar Bar = GetCommandBar(CodeDepotRes.ProgID);
if(Bar!=null)
commands.RemoveCommandBar(Bar);
Bar=(CommandBar)commands.AddCommandBar(CodeDepotRes.ProgID,vsCommandBarType.vsCommandBarTypeToolbar,null,0);
CommandBarButton btn = (CommandBarButton) cmd.AddControl(Bar, 1);
btn.Style = MsoButtonStyle.msoButtonIcon;
CommandBarComboBox DropBox = (CommandBarComboBox) Bar.Controls.Add(
MsoControlType.msoControlDropdown,oMissing,oMissing,oMissing,oMissing);
DropBox.Width=300;
DropBox.AddItem("[Open Code Depot Manager]",oMissing);
DropBox.Caption = "Snipets:";
DropBox.Style = MsoComboStyle.msoComboLabel;
}
catch(System.Exception Err)
{
Debug.WriteLine("OnConnect:"+Err.Message);
}
}
}
Any thoughts would be greatly appreciated...
|
|
|
|
|
hi
how to create arraylist files?
i want to add modifi and erase inside datas
help me
thanks
|
|
|
|
|