memyself Posted December 7, 2007 at 07:53 PM Report Share #152979 Posted December 7, 2007 at 07:53 PM boas pessoal... fiz uma pesquisa e nao encontrei o que procuro é o seguinte: como faco para colocar um icone na minha aplicacao ?? (usando codigo no load da form) tentei com este codigo mas nao me deu resultado: Me.Icon = Image.FromFile("C:\Users\maps\Documents\My Projects\My Library\Movie Library\bin\Debug\icons\file 1.jpg") ao usar isso, da-me este erro: Error 1 Value of type 'System.Drawing.Image' cannot be converted to 'System.Drawing.Icon' aguardo uma resposta de alguem sei que neste forum ha sempre alguem que consegue ajudar cumpz Link to comment Share on other sites More sharing options...
Tiago Salgado Posted December 7, 2007 at 08:03 PM Report Share #152982 Posted December 7, 2007 at 08:03 PM Nem te deste sequer ao trabalho de ler a mensagem de erro. Estás a carregar uma imagem em JPG em vez de ICO. Podes tb definir o icon directamente nas propriedades do formulário, nao necessitas de fazer por código. Link to comment Share on other sites More sharing options...
memyself Posted December 7, 2007 at 08:19 PM Author Report Share #152989 Posted December 7, 2007 at 08:19 PM Nem te deste sequer ao trabalho de ler a mensagem de erro. Estás a carregar uma imagem em JPG em vez de ICO. Podes tb definir o icon directamente nas propriedades do formulário, nao necessitas de fazer por código. aí é que te enganas... eu percebo bastante bem ingles... o meu problema é que eu estou a usar uma imagem ICO (é um icone)... dai a minha duvida quanto a este erro nao percebo porque obrigado na mesma pela tentativa cumpz Link to comment Share on other sites More sharing options...
Betovsky Posted December 7, 2007 at 09:00 PM Report Share #153002 Posted December 7, 2007 at 09:00 PM Image.FromFile <--- Obtens um objecto do tipo System.Drawing.Image Me.Icon <--- Recebe um objecto do tipo System.Drawing.Icon Estás a ver o problema? É exactamente essa a mensagem de erro. O que queres é Me.Icon = new Icon("C:\Users\maps\Documents\My Projects\My Library\Movie Library\bin\Debug\icons\file 1.jpg") "Give a man a fish and he will eat for a day; Teach a man to fish and he will eat for a lifetime. The moral? READ THE MANUAL !" Sign on a computer system consultant's desk Link to comment Share on other sites More sharing options...
memyself Posted December 7, 2007 at 09:49 PM Author Report Share #153012 Posted December 7, 2007 at 09:49 PM brigadao Betovsky era isso mesmo que tava a precisar... agora outra coisa ainda nao experimentei mas ja vou tentar... posso usar o mesmo metodo para introduzir os icones/imagens nos menus e toolbars ?? é que eu preciso de saber isso, porque a minha aplicacao vai usar uma janela mas mudar os comandos consoante o que se esta a fazer... agradeco desde ja cumpz Link to comment Share on other sites More sharing options...
Joca Posted December 11, 2007 at 11:10 PM Report Share #153781 Posted December 11, 2007 at 11:10 PM É isto que queres? Fonte: ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_fxmclictl/html/aa5f19bb-b545-4378-bfa6-36ba592f0d7c.htm "To add an image to a menu command: Set the menu command's Image property to the name of the image. If the ToolStripItemDisplayStyle property of this menu command is set to Text or None, the image cannot be displayed. Note: The image margin can also show a check mark if you so choose. Also, you can set the Checked property of the image to true, and the image will appear with a hatched border around it at run time." Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now