Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

anu81

@anu81
About
Posts
115
Topics
67
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Get all items in a listView with cell template
    A anu81

    Hi all, I have a listview control which is binded with gridview columns binded to cell template with static resource. my listview is bounded to a list of class objects as itemssource.i am trying to get all the items using the below code. GridView gridView = lvView.View as GridView; foreach (TicketExceptions item in lvView.Items) { VirtualizingStackPanel vsp = (VirtualizingStackPanel)typeof(ItemsControl).InvokeMember ("_itemsHost", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic, null, lvView, null); double scrollHeight = vsp.ScrollOwner.ScrollableHeight; double offset = (scrollHeight * lvView.Items.IndexOf(item)) / lvView.Items.Count; // itemIndex_ is index of the item which we want to show in the middle of the view vsp.SetVerticalOffset(offset); lvView.ScrollIntoView(item); ListViewItem item1 = lvView.ItemContainerGenerator.ContainerFromIndex(lvView.Items.IndexOf(item)) as ListViewItem; // item1 returns null for few items GridViewRowPresenter rowPresenter = GetFrameworkElementByName<GridViewRowPresenter>(item1); foreach (PropertyInfo info in item.GetType().GetProperties()) { for (int col = 0; col < colcount; col++) { if (rowPresenter != null) { ContentPresenter templatedParent = VisualTreeHelper.GetChild(rowPresenter, col) as ContentPresenter; TextBlock block = (TextBlock)gridView.Columns[col].CellTemplate.FindName(info.Name, templatedParent); if (block != null) { } } } } But the ItemContainerGenerator returns null for few items. when i checked, i see that only the items which are in visible in the listview (rather than scrolling) returns object using the above method, but others return null. i am able to see all the items in the listview. How can i get the container of the items without scrolling.

    Thanks in advance.:) Regards Anuradha

    WCF and WF database docker question learning

  • Remoting using TCP/IP
    A anu81

    hi all, i have written a service in vb.net which repeatedly processes messages in the messagequeue. i send a message from messagequeue to a server through a gateway and wait for the response. I am using TCP Client that listens to a port, to send message to the gateway(an application that interacts with the server)and receive response from the server through the gateway. I am able to send and receive message from the gateway. The time taken to send message to the gateway is quick(1 or 2 seconds). but the response i get from the gateway takes a longer time. around 40 seconds. The server part of coding is done by another person and i dont have permissions to that side. How can i receive a faster response? is there anything i can do to improve it or should it be done in the server side?

    Thanks in advance.:) Regards Anuradha

    Visual Basic question csharp sysadmin code-review

  • Writing xml file from dataset
    A anu81

    hi all, I have a dataset which has four tables. say for eg, Table A, Table B, Table C and Table D. Table A and Table B are related using PK - FK relation.Table B and Table D are related using PK - FK relation. Table A and Table C are related using PK - FK relation. i need to create a xml file based on these relations. i need to have a node which has the related values of all the tables. I tried using a single query to extract values based on inner joins. but that comes as a single table and the nodes are repeated. or can anybody suggest me how to group two tables into a single node in xml. i can do all this by manually creating a xml file from the dataset. but I am using dataset.WriteXml method to create the xml file. Is there any option to do this?

    Thanks in advance.:) Regards Anuradha

    C# database xml tutorial question

  • Help regarding MSI serial key validation
    A anu81

    hi all, I am using ORCA to validate the product key in C# 2005 windows application. i am using the following C++ code in a dll to be added to the MSI for validation. UINT __stdcall ValidateSerial(MSIHANDLE hInstall) { TCHAR szPidKey[PIDKEY_LENGTH]; DWORD dwLen = sizeof(szPidKey) / sizeof(szPidKey[0]); ///retrieve the text entered by the user UINT res = MsiGetPropertyA(hInstall, _T("PIDKEY"), szPidKey, &dwLen); if(res != ERROR_SUCCESS) { //fail the installation return 1; } bool snIsValid = true; //validate the text from szPidKey according to your algorithm //put the result in snIsValid //the template we use is <###-####> = ; # digit between 0 and 9 //the algorithm is very simple (XY * Z + 7) * 13 = ABCD / 2 int xy = DIGIT(szPidKey[0]) * 10 + DIGIT(szPidKey[1]); int z = DIGIT(szPidKey[2]); int left = ((xy * z + 7) * 13 ) * 2; int right = DIGIT(szPidKey[4]); right = right * 10 + DIGIT(szPidKey[5]); right = right * 10 + DIGIT(szPidKey[6]); right = right * 10 + DIGIT(szPidKey[7]); snIsValid = (left != 0) && (right != 0) && (left == right); TCHAR * serialValid = NULL; if(snIsValid) serialValid = _T("TRUE"); else { //eventually say something to the user ::MessageBox(0, _T("Invalid Serial Number"), _T("Message"), MB_ICONSTOP); serialValid = _T("FALSE"); } res = MsiSetPropertyA(hInstall, _T("SERIAL_VALIDATION"), serialValid); if(res != ERROR_SUCCESS) { //fail the installation return 1; } //the validation succeeded - even the serial is wrong //if the SERIAL_VALIDATION was set to FALSE the installation will not continue return 0; } but when i execute the above code, i am getting the following error. error LNK2019: unresolved external symbol _MsiSetPropertyA@12 referenced in function "unsigned int __stdcall ValidateSerial(unsigned long)" (?ValidateSerial@@YGIK@Z) CustomAction.obj i have included and I am a beginner in VC++ and could anybody help me with some suggestions Thanks in advance.:) Regards Anuradha

    C / C++ / MFC help csharp c++ algorithms question

  • Comparing two xml files
    A anu81

    hi all, I want to compare 2 xml files with each other. One xml file is standard on my pc and has the name standard.xml. the other xml file is on the server and has the name server.xml i want to compare these 2 files with each other and if it contains new info it should be added in the pc.xml file. in msdn, i found that XML diff and patch tool is used to compare two xml files. but i do not want to add a additional tool to be installed for this purpose. i tried to do the comparison by getting the nodes in a XmlNodeList and comparing the two nodelists. but i am struck at one point. how can i find out whether a node already exists in a xml document. say for eg, in my xml file,i have a structure like this, <Main> <url type_node="S" tool_tip="http://www.mysite.com/sample.xml">http://www.mysite.com/sample.xml</url> <Category2> <url type_node="S" tool_tip="http://www.mysite.com/sample1.xml">http://www.mysite.com/sample1.xml</url> </Category2> </Main> in this, Category2 is a childnode of Main. i want to check if the url element for sample exists already in the document. how can i do this. i tried using xmldoc.getElementsByTagName(node.innerText); but i am always getting a count of 1 even if the node does not exits in the document. Hope i am clear in my question. Any suggestions?

    Thanks in advance.:) Regards Anuradha

    XML / XSL question com sysadmin xml

  • Wrapping a text in textbox
    A anu81

    hi, Thanks so much for your help. i got it working now. i had added the picturebox and two textboxes during design time. now i added them at runtime and set the all properties again. now its working fine although i have a vertical scrollbar for the textbox. but without that the panel becomes so big so its better i have the vertical scrollbar. thanks once again for your help. Regards Anuradha

    C# question

  • Wrapping a text in textbox
    A anu81

    hi, i am actually trying with a real paragraph which is obtained dynamically. when i put a dummy paragraph and tested its working fine. but when i put the dynamic content which contains more paragraphs, the text is not wrapped properly. Any ideas? and thanks for the response. Regards Anuradha

    C# question

  • Wrapping a text in textbox
    A anu81

    hi all, I have a panel which contains a picturebox and two textboxes. in one of the textbox, some large content is to be displayed. this content is dynamic and i want the textbox to wrap the text accordingly. i set the textbox multiline property to true and also set wordwrap=true. inaddition i set the acceptsreturn=true. but still the text is not wrapped. how can i achieve this?

    Thanks in advance.:) Regards Anuradha

    C# question

  • Itemmouseoverevent in listview
    A anu81

    hi all, so stupid of me. sorry for troubling you people. i commited a silly mistake. the event is not triggered at all because the code in the designer.cs got deleted. did not notice that. thanks for viewing and sorry for the wrong post. Regards Anuradha

    C# question graphics help

  • Itemmouseoverevent in listview
    A anu81

    hi all, I am using listview where i draw the items by setting the ownerdraw property true and drawing using the drawitem event. this works fine. now when i mouseover an item in listview, i need to show a small popup with the details of the item. i found itemmouseover event which works only when the ownerdraw property is false.(ie the items are not drawn manually). how can i achieve this task? Please help me with suggestions.

    Thanks in advance.:) Regards Anuradha

    C# question graphics help

  • Vertical scrollbar in listview
    A anu81

    hi all, I want to handle the event for vertical scrollbar of a listview. instead of displaying the vertical scrollbar, i need to display a button which handles some functionality. How can i do this? Please help me with some links or suggestions

    Thanks in advance.:) Regards Anuradha

    C# question help

  • help regarding windows media player
    A anu81

    hi, thanks for your reply. probably i did not put myself correctly. the quicktime format files are not played in media player. how can i play quick time formats using embed tag (i mean what type of object has to be embeded to play quicktime files)?.

    Thanks in advance.:) Regards Anuradha

    C# html adobe hardware help question

  • help regarding windows media player
    A anu81

    hi all, I have a windows application in which i am using a webbrowser control. i write a html file which includes playing different types of media files like audio, video and flash files. I embedded media player for video and audio files and for flash the flash player. when i execute quicktime files(video) its not playing in the media player. i need to play the quicktime formats also in the media player if i give the URL. is it possible?

    Thanks in advance.:) Regards Anuradha

    C# html adobe hardware help question

  • Help regarding FileSystemWatcher
    A anu81

    hi all, I need to monitor a folder (also for the subdirectories) for changes or renaming. i am trying to use the File system watcher control and has set the path of the directory. i have written code in the rename event of filesystem watcher public void OnRenameEvent(Object sender, RenamedEventArgs e) { MessageBox.Show(e.OldName); } i have set the EnableRaisingEvents as true. but still when i am trying to rename the folder, the event is not getting triggered. What am i missing here?

    Thanks in advance.:) Regards Anuradha

    C# help question

  • Machine gets restarted often
    A anu81

    hi, Thanks very much for your response. I have posted in the bleeping computer forums. Thanks once again Regards Anuradha

    System Admin sysadmin debugging help database sql-server

  • Machine gets restarted often
    A anu81

    hi all, I am using Windows XP with service pack2 which was working fine till one month earlier. now my machine gets restarted every five minutes. i could not find the reason for it. i had already asked a suggestion here, about the local network connection plugin. until it gets started i could not perform any other operation. but now, even after the connection is loaded, my machine gets restarted. on tracing the event viewer, i found out the following errors. Event id :7034 The Message Queuing service terminated unexpectedly. It has done this 1 time(s). Event Id : 7001 The Message Queuing Triggers service depends on the Message Queuing service which failed to start because of the following error: After starting, the service hung in a start-pending state. Event ID : 7022 The Message Queuing service hung on starting. Event iD:7023 The Computer Browser service terminated with the following error: This operation returned because the timeout period expired. Event ID:7024 The SQL Server (SQLEXPRESS) service terminated with service-specific error 2148081668 (0x80092004). Event ID : 7000 The Google Update Service service failed to start due to the following error: The system cannot find the path specified. Event Id:7001 The avast! Antivirus service depends on the avast! Standard Shield Support service which failed to start because of the following error: The system cannot find the file specified. The avast! Standard Shield Support service failed to start due to the following error: The system cannot find the file specified. Application POpup Application popup: mqsvc.exe - Application Error : The exception Breakpoint A breakpoint has been reached. (0x80000003) occurred in the application at location 0x00000000. Click on OK to terminate the program Click on CANCEL to debug the program i think might be due to the messanging service. could i set the service to manual instead of automatic. Please help me with suggestions

    Thanks in advance.:) Regards Anuradha

    System Admin sysadmin debugging help database sql-server

  • Help with images in listview
    A anu81

    hi all, I have a listview in which i am trying to display thumbnail images along with text like the windows explorer. I am able to display the thumbnail view with lots of help from members here. and i tried of sorting out the flickering problem in listview. but when i try to drag the vertical scrollbar down or up rather, the images are not aligned properly and it sort of is overwritten over one another. here is the code i used for drawing the item(having set the owner draw property true).this is just a sample code with the controls having their default names. private void listView1_DrawItem(object sender, System.Windows.Forms.DrawListViewItemEventArgs e) { if (imageList1.Images.Count > 0) { // Draw the item text for views other than the Details view. if (listView1.View != View.Details) { //Image newimage = new Bitmap(imageList1.Images[e.ItemIndex]); Image newimage = new Bitmap(imageList1.Images[0]); left = e.Bounds.Left + 5; top = e.Bounds.Y + this.Height / 7; width = newimage.Width + 5; height = newimage.Height - 25; textbrush = new SolidBrush(Color.FromArgb(255, 236, 233, 216)); Rectangle text_rect = new Rectangle(left, top, width, height); text = e.Item.Text; DrawRoundedRectangle(e.Graphics, new Pen(textbrush), Color.White, text_rect, new Size(8, 8), newimage, text); left = left + 20; top = top + 130; text_rect = new Rectangle(left - 5, top - 25, width - 30, 20); DrawRoundedRectangle(e.Graphics, new Pen(new SolidBrush(Color.White)), Color.White, text_rect, new Size(1, 1), null, text); listView1.EnsureVisible(e.ItemIndex); } } } public void DrawRoundedRectangle(Graphics g, Pen p, Color backColor, Rectangle rc, Size size, Image img, string text) { Point[] points = new Point[8]; //prepare points for poligon points[0].X = rc.Left + size.Width / 2; points[0].Y = rc.Top + 1; points[1].X = rc.Right - size.Width / 2; points[1].Y = rc.Top + 1; points[2].X = rc.Right; points[2].Y = rc.Top + size.Height / 2;

    C# graphics help algorithms

  • Help with css in anchor tags
    A anu81

    hi, Thanks for the reply. but by default, the visited link color (red) is only displayed. If i dont give the css for visited, the link color is displayed. Also in the set_values function, i am submitting the form again for some manipulation. Hope i am clear in my explanation.

    Thanks in advance.:) Regards Anuradha

    ASP.NET question css help

  • Help with css in anchor tags
    A anu81

    hi all, I have a link like this Edit/ in the css class link a.link { color:#999999; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; text-decoration: none; } a.link:visited { color:red; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; text-decoration: none; } a.link:hover { color:#996600; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; text-decoration: none; } i have written the above css. now if i execute my application, the edit text is displayed in visited link color(red) even before it is visited. How can i differentiate between visited and unvisited links by color? Thanks in advance.:) Regards Anuradha

    ASP.NET question css help

  • Help regarding master pages
    A anu81

    hi, oh ya.i did not notice that. sorry for the inconvinience. thanks for your suggestions. I will try it out.

    Thanks Regards Anuradha

    ASP.NET question javascript help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups